-
Notifications
You must be signed in to change notification settings - Fork 70
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
Change default cache directory to user's home #103
Comments
We're going to need additional details about "default shared cache directory is changed to user's home". There are some cases where this does not occur. |
Added more content in the "Restrictions" part. |
and what about group access? |
|
Sorry scratch that, I guess the single PR enables caches in the home directory. |
Added "The default shared cache and snapshot directory is still /tmp/javasharedresources/ if "groupAccess" is used" |
Please add a migration story, what users should do if they have created a Java 11 shared cache before this was introduced. |
Added a migration section. |
Snapshots should be mentioned as well since they are affected. |
Added cache snapshot in the migration part. |
A few questions for starters (feel free to point out that the answers will be obvious to Java users if that's the case!):
|
To put the default cache in a location that is not writable by all users.
Mostly for debugging pr service purposes. These changes are a pre-cursor to enabling bootClassesOnly by default. Having the option allows additional command line options to be enabled at the same time, such as the verbose options. It is also possible a user may want to enable shared classes only for bootstrap classes, perhaps to reduce the risk of using shared classes, although no one has ever requested this.
See the answer above. bootClassesOnly will be enabled by default at a future time, and by default we want nonfatal as well. Having bootClassesOnly enable it avoid mistakes. Adding fatal allows control over this behavior for debugging or service, or by some chance a user wants to enable bootClassesOnly but have the JVM fail to start if something is wrong with the shared cache. |
@hangshao0 please answer 4. |
Thanks Peter. Another question - there are statements like
but currently the docs say that's a restriction only for persistent caches on AIX - is that still the case?
|
The AIX part is misleading, it is a restriction for persistent caches on all Windows, Linux and AIX (z/OS doesn't support persistent caches). |
See issue eclipse-openj9#103: eclipse-openj9#103 - New suboptions are bootClassesOnly and fatal. - The default dir has changed from a temp dir to the user's home dir, on non-Windows platforms only, and only if groupAccess is not also specified. [skip ci] Signed-off-by: Esther Dovey <doveye@uk.ibm.com>
Hi @hangshao0 and @pshipton . I've made the doc updates (inadvertently skipped the staging part, oops). They are visible here:
I've removed the AIX mention in the existing NFS sentence too, thanks Peter for clarifying that. |
lgtm except the following in the What's New draft is not entirely accurate.
The JVM attempts to delete the obsolete cache and create a new one. Unlike on Linux/AIX, on Windows a file cannot be deleted if it is in use. In this case the new JVM will continue to use the older cache if the older cache cannot be deleted. I missed a point in #103 (comment). The bootClassesOnly option is also useful if you want this behavior but need to change the default cacheDir location. |
There will be an NLS saying what stopped shared class from starting up. The message is different depending on what the error condition is. |
Re #103 (comment):
I'm not sure what you mean by "this behavior" in this sentence?
|
lgtm.
The bootClassesOnly option is useful if you want to have the equivalent of that is going to be enabled by default, but change the default cacheDir. I don't expect this needs to be called out in the doc, its just a point I missed mentioning earlier. |
Ok, thanks for the clarification :) |
Think we can close this now. |
Issue or pull request number:
eclipse-openj9/openj9#2862
Overview:
1. The default shared cache and cache snapshot directory is changed to user's home on OpenJ9 Java 11 and up on non-Windows platforms if -Xshareclasses:groupAccess is not used. The default shared cache and snapshot directory is still /tmp/javasharedresources/ if "groupAccess" is used.
2. New sub-options -Xshareclasses:bootClassesOnly and -Xshareclasses:fatal
Applies to the following JDK versions:
1. Java 11 and later for the change of default cache directory
2. Java 8 and up for the new bootClassesOnly and fatal option
Applies to the following platforms:
1. AIX, Linux X|P|Z, z/OS, for the change of default cache directory
2. All platforms, for bootClassesOnly and fatal option
For new command line options:
N.A.
Option "bootClassesOnly": Disable caching of classes loaded by the non-bootstrap class loaders. This option also turns on option "nonfatal".
Option "fatal": Do not start up the shared cache if an error occurs. This option is turned on by default except when "bootClassesOnly" is used. User can use -Xshareclasses:bootClassesOnly,fatal if they want the shared cache error to be fatal.
With -Xshareclasses, if we cannot user user's home as the cache directory (e.g. home is on a NFS or an error occurs when getting the home directory, etc.):
Migration:
Users that always use "groupAccess" or "cacheDir=" in the CML won't be affected by this change.
Shared caches and cache snapshots created in the obsolete default directory (/tmp/javasharedresources/) by an old JDK11 without this change cannot be started up by the new JDK11. User can use "-Xshareclasses:cacheDir=/tmp/javasharedresources/,listAllCaches" ("cacheDir=/tmp" for nonpersistent cache and snapshot) to find the caches (and cache snapshots) in the obsolete default directory. If an old shared cache is not useful anymore, use "-Xshareclasses:cacheDir=/tmp/javasharedresources/,name=cacheName,destroy" to remove it, For cache snapshot, use "-Xshareclasses:cacheDir=/tmp,name=snapshotName,destroySnapshot" to remove it.
If user does not destroy the old shared cache or cache snapshot in the obsolete default directory, and the new JDK 11 is creating a new shared cache or cache snapshot with "-Xshareclasses:name=existingCacheName,cacheDir=/tmp/javasharedresources/" ("cacheDir=/tmp" for nonpersistent cache and snapshot), the old shared cache or cache snapshot will be automatically deleted and a new one will be created.
If "cacheDir=" or "groupAccess" is not used in the CML, please make sure the user's home directory is not on a NFS.
The text was updated successfully, but these errors were encountered: