-
Notifications
You must be signed in to change notification settings - Fork 328
[WIP] Changes the memory allocator to use jemalloc to address memory leak issues #3566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
ba33907
7eaf1a8
df47648
6ec1952
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,6 +104,9 @@ endif | |
|
|
||
| nemo_deps = [ cinnamon, gail, glib, gtk, math, | ||
| egg, nemo_extension, nemo_private, xapp ] | ||
| if use_jemalloc | ||
| nemo_deps += jemalloc | ||
| endif | ||
|
|
||
| if exempi_enabled | ||
| nemo_deps += exempi | ||
|
|
@@ -113,27 +116,45 @@ if libexif_enabled | |
| nemo_deps += libexif | ||
| endif | ||
|
|
||
|
|
||
| nemo_link_args = [] | ||
| if use_jemalloc | ||
| nemo_link_args += ['-Wl,--no-as-needed', '-ljemalloc', '-Wl,--as-needed'] | ||
| endif | ||
| nemo = executable('nemo', | ||
| nemoCommon_sources + nemoWindow_sources, | ||
| include_directories: [ rootInclude ], | ||
| c_args: nemo_definitions, | ||
| dependencies: nemo_deps, | ||
| link_args: nemo_link_args, | ||
| install: true | ||
| ) | ||
|
|
||
|
|
||
| nemoDesktop_link_args = [] | ||
| if use_jemalloc | ||
| nemoDesktop_link_args += ['-Wl,--no-as-needed', '-ljemalloc', '-Wl,--as-needed'] | ||
| endif | ||
| nemoDesktop = executable('nemo-desktop', | ||
| nemoCommon_sources + nemoDesktop_sources, | ||
| include_directories: [ rootInclude], | ||
| c_args: nemo_definitions, | ||
| dependencies: nemo_deps, | ||
| link_args: nemoDesktop_link_args, | ||
| install: true | ||
| ) | ||
|
|
||
|
|
||
| nemo_autorun_software_link_args = [] | ||
| if use_jemalloc | ||
| nemo_autorun_software_link_args += ['-Wl,--no-as-needed', '-ljemalloc', '-Wl,--as-needed'] | ||
| endif | ||
| nemo_autorun_software = executable('nemo-autorun-software', | ||
| [ 'nemo-autorun-software.c' ], | ||
| include_directories: [ rootInclude, ], | ||
| c_args: nemo_definitions, | ||
| dependencies: nemo_deps, | ||
| link_args: nemo_autorun_software_link_args, | ||
| install: true | ||
| ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this needs to use jemalloc, it's just a Gtk dialog for when media gets inserted. |
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,20 @@ | |
| #include <exempi/xmp.h> | ||
| #endif | ||
|
|
||
| #ifdef USE_JEMALLOC | ||
| static void | ||
| nemo_jemalloc_configure(void) __attribute__((constructor)); | ||
|
|
||
| static void | ||
| nemo_jemalloc_configure(void) | ||
| { | ||
| if (getenv("MALLOC_CONF") != NULL) | ||
| return; | ||
| const char *conf = "narenas:1,metadata_thp:auto,percpu_arena:phycpu"; | ||
| setenv("MALLOC_CONF", conf, 0); | ||
| } | ||
| #endif | ||
|
|
||
| int | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block probably needs to be in nemo-desktop-main.c also?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly, I'm not sure, I ran the tests with the file manager, but I didn't test the desktop part.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We probably wouldn't need to worry about it there, it's used strictly for the desktop view, any folders opened from there launch the nemo-main process. I imagine the memory stays fairly static. |
||
| main (int argc, char *argv[]) | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.