Skip to content

Periodically issue malloc_trim at JITServer client - #19506

Merged
mpirvu merged 1 commit into
eclipse-openj9:masterfrom
cjjdespres:malloc-trim
May 16, 2024
Merged

Periodically issue malloc_trim at JITServer client#19506
mpirvu merged 1 commit into
eclipse-openj9:masterfrom
cjjdespres:malloc-trim

Conversation

@cjjdespres

Copy link
Copy Markdown
Contributor

JITServer clients will now periodically call malloc_trim(0), at a configurable interval set by the new option
-Xjit:jitserverMallocTrimInterval=<time in ms>. The default is every 30s (30000ms). Setting the interval to 0 will disable the feature entirely.

@cjjdespres
cjjdespres requested a review from dsouzai as a code owner May 16, 2024 13:53
@cjjdespres

Copy link
Copy Markdown
Contributor Author

Attn @mpirvu.

@mpirvu mpirvu self-assigned this May 16, 2024
@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label May 16, 2024

@mpirvu mpirvu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I only have a minor suggestion.

CalculateOverallCompCPUUtilization(compInfo, crtTime, samplerThread);
}
#if defined(J9VM_OPT_JITSERVER) && defined(LINUX)
static uint64_t lastMallocTrimTime = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this need to be indented more?
Since the next block (line 6736) already has #if defined(J9VM_OPT_JITSERVER) , maybe insert this new code under the same ifdef and just add #if defined(LINUX)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

JITServer clients will now periodically call malloc_trim(0), at a
configurable interval set by the new option
-Xjit:jitserverMallocTrimInterval=<time in ms>. The default is every
30s (30000ms). Setting this interval to 0 will disable the feature
entirely.

Signed-off-by: Christian Despres <despresc@ibm.com>
@mpirvu

mpirvu commented May 16, 2024

Copy link
Copy Markdown
Contributor

jenkins test sanity xlinuxjit,zlinuxjit,alinux64jit jdk17

@mpirvu
mpirvu merged commit a56cbdf into eclipse-openj9:master May 16, 2024
@knn-k

knn-k commented May 17, 2024

Copy link
Copy Markdown
Contributor

This commit caused a build break on macOS.

See https://openj9-jenkins.osuosl.org/job/Build_JDK11_x86-64_mac_Nightly/819/consoleText for example:

[2024-05-17T00:04:44.081Z] /Users/jenkins/workspace/Build_JDK11_x86-64_mac_Nightly/openj9/runtime/compiler/control/HookedByTheJit.cpp:25:10: fatal error: 'malloc.h' file not found
[2024-05-17T00:04:44.081Z] #include <malloc.h>

@knn-k

knn-k commented May 17, 2024

Copy link
Copy Markdown
Contributor

It seems there is already a PR to fix it: #19510

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:jitserver Artifacts related to JIT-as-a-Service project

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants