-
Notifications
You must be signed in to change notification settings - Fork 729
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
Set cache dir to user's home directory #2862
Conversation
210b2f2
to
22ef22a
Compare
For consistency, I expect the shared cache location should always default to the home directory. If we can agree on this, we should also discuss a migration strategy since existing VMs use the temp directory. |
The home directory might not be accessible to other users. This might break users using "groupAccess". Probably we can use home directory if "groupAccess" is not in use. |
@pshipton, Do you agree to set cache directory to user's home only when "groupAccess" is not in use ? |
Yes, for compatibility it seems necessary. I think what we need is a list of scenarios and what will occur in each. This will help ensure everything is covered properly, and the documentation is updated appropriately. Here is a starter list.
|
Then the new JVM will use the cache in the home directory. Users can always delete the caches in /tmp using "cacheDir=/tmp,destroy".
Currently yes.
We can use -Xshareclasses:destroy.
They will share the same cache. |
Will JVMs which haven't enabled -Xshareclasses load non-bootstrap classes from the cache?
|
|
No
It is the same as the default cache size. 300MB with 64softmx on 64-bit platforms and 16MB on 32 bit platforms.
By changing the setting of user home, or environment variable "HOME". (There is another way to do this , by using -Xshareclasses:CacheDir=/dir/,bootClassesOnly.)
By using -Xshareclasses:none
The default class sharing is equivalent to -Xshareclasses:cacheDir=userhome,nonfatal,bootClassesOnly. Nonfatal can be turn on by using -Xshareclasses:cacheDir=userhome,bootClassesOnly.
Yes. There will be a trace point if the default shared cache failed to start up. And the size of the default shared cache can be set by -XX:SharedCacheHardLimit= and -Xscmx |
Discussed with Peter, I will try on some real applications with -Xshareclasses:bootClassesOnly to see if the bootstrap shared cache gradually grows in size. |
I suggest bootClassesOnly implies nonfatal. A new "fatal" option (although I don't like this name) can be added so -Xshareclasses:bootClassesOnly is equivalent to the default, and -Xshareclasses:bootClassesOnly,fatal can disable it if desired. |
Another point we discussed
Default bootClassesOnly is disabled. |
The change is ready to be reviewed again. |
Please open the doc issue, this change cannot be merged without the documentation being ready to go as well. |
runtime/port/sysvipc/j9shmem.c
Outdated
Assert_PRT_true(TRUE == appendBaseDir); | ||
uintptr_t baseDirLen = strlen(J9SH_BASEDIR); | ||
/* From https://linux.die.net/man/3/getpwuid: | ||
* "An application that wants to determine its user's home directory should inspect the value of HOME (rather than the value getpwuid(getuid())->pw_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't copy the text from the Linux man pages. You can paraphrase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
OpenJ9 doc issue created: eclipse-openj9/openj9-docs#103. We never documented the debug options from -Xshareclasses:morehelp, I guess we do not need to document -Xshareclasses:bootClassesOnly and -Xshareclasses:fatal either ? (Though "bootClassesOnly" and "fatal" are in the doc change request for now) |
bootClassesOnly and fatal should be first class options shown via -Xshareclasses:help |
1. Set cache dir to user's home directory if groupAccess is not presents on Java 11 2. Add a new debug option bootClassesOnly 3. Set J9SHR_RUNTIMEFLAG_ENABLE_CACHE_NON_BOOT_CLASSES by default, remove this flag if option bootClassesOnly presents 4. Change the second parameter of j9shmem_getDir(). 5. Change the first parameter of getCacheDir(). Signed-off-by: hangshao <[email protected]>
Moved bootClassesOnly and fatal to -Xshareclasses:help |
jenkins test all plinux jdk11 |
jenkins test sanity plinux jdk11 |
jenkins test extended plinux jdk11 |
jenkins test sanity plinux jdk11 |
jenkins compile win,zlinux jdk8 |
jenkins compile aix jdk8 |
The compile failures are a result of #3158 and can be ignored. |
@SueChaplain I've added a review on this for you so you can indicate when the doc changes are ready to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not merge before doc changes are ready.
jenkins compile aix,zlinux jdk8 |
jenkins compile xlinux,plinux jdk8 |
1 similar comment
jenkins compile xlinux,plinux jdk8 |
jenkins compile plinux jdk8 |
1 similar comment
jenkins compile plinux jdk8 |
jenkins test sanity plinux jdk8 |
presents on Java 11
remove this flag if option bootClassesOnly presents
Doc change eclipse-openj9/openj9-docs#103.
Signed-off-by: hangshao [email protected]