Saturday, February 7, 2015

Linux, Oracle RDBMS -- JOXSHM_EXT/java_jit_enabled & open files limit

Oracle database (enabled by default in 11g) has a feature for caching the compiled java code..

It called JVM JIT compilation and it is controlled by "java_jit_enabled" parameter

This caching of java code feature is for the java code we access in the database. Remember we have

Thus, the system does not need to interpret the JVM bytecode everytime we run a java code.

Rather than compiling the code in the runtime, Oracle uses the compiled java code which is stored in the JOX files, in other words it uses the compiled code in the cache.
In the process level; 
Oracle process maps the JOX files into its address space with a mmap() system call. So, any time this compiled java code has to be executed, your Oracle process can just jump to the compiled method address --Ref: Tanel Poder.

Note that : these cache files (it is file based cache) are stored in the /dev/shm filesystem.. Cache files ar : /dev/shm/JOXSHM_EXT*

Okay.. So far so good.. 
But, the purpose of this post is to show you something else.. 

I have looked these cache mechanism(file based) from the Linux perspective and noticed the following;

I have noticed that because of the “jit” behavior, we may reach OS open file limits..
I also have checked the /dev/shm/JOXSHM_EXT* files, they are not stale…

It seems we need to increase OS open file limits accordingly…
Look ;

lsof |grep /dev/shm/JOX |wc -l

lsof | wc -l

So , as we see above; almost %64 of total filehandles are used for reaching this cache files..
In conclusion, we need to increase our open file limits according to this info.
If we ave a lot of oracle processes, then we will have a lot cache files mapped to their address spaces and this may trigger open file limits problem..
Even if we have few number of cache files under /dev/shm directory.. Think 1000 processes map 80 cache files .. It makes 80000 open files..

So keep that in mind ..

No comments :

Post a Comment