Skip to content

Periodically issue malloc_trim at JITServer client #19506

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

Merged
merged 1 commit into from
May 16, 2024

Conversation

cjjdespres
Copy link
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
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
Copy link
Contributor

@mpirvu mpirvu left a comment

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.

@@ -6721,6 +6722,16 @@ static int32_t J9THREAD_PROC samplerThreadProc(void * entryarg)
{
CalculateOverallCompCPUUtilization(compInfo, crtTime, samplerThread);
}
#if defined(J9VM_OPT_JITSERVER) && defined(LINUX)
static uint64_t lastMallocTrimTime = 0;
Copy link
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
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 <[email protected]>
@mpirvu
Copy link
Contributor

mpirvu commented May 16, 2024

jenkins test sanity xlinuxjit,zlinuxjit,alinux64jit jdk17

@mpirvu mpirvu merged commit a56cbdf into eclipse-openj9:master May 16, 2024
9 checks passed
@knn-k
Copy link
Contributor

knn-k commented May 17, 2024

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
Copy link
Contributor

knn-k commented May 17, 2024

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