JDK-8062384 : Code cache was saved in current directory
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 8u40,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: linux
  • CPU: generic
  • Submitted: 2014-10-29
  • Updated: 2014-11-05
  • Resolved: 2014-11-05
Related Reports
Relates :  
Relates :  
Description
I tried run  simple script with jjs and engine.eval() with options --persistent-code-cache=true
and i see that cache saved in nashorn_code_cache in current directory.
But in JDK-8046921 described that directory should be ~/.cache/.

Comments
Like Attila said, code caching is different from type caching. The reason for storing compiled classes in a user facing directory was that code caching generates much more data than type caching, and it would seem wrong to use a lot of disk space in a way that is hidden from the user. The default location of the directory can be canged by setting the "nashorn.persistent.code.cache" system property.
05-11-2014

Nashorn can cache both generated code and type information for deoptimizing recompilation; these two caches are distinct. JDK-8046921 describes type info caching, not code caching. That said, it's worth reviewing whether the default for code cache should be the current directory.
03-11-2014