LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Lock or pin java process into memory. (http://www.linuxquestions.org/questions/programming-9/lock-or-pin-java-process-into-memory-838079/)

parikpol 10-14-2010 12:58 PM

Lock or pin java process into memory.
 
Hi,

Is there a way to lock a java process into memory.

Using something like mlock/mlockall it is possible to lock the memory of a process into memory, so that it doesn't get swapped out. With this approach is it possible to write a C wrapper before invoking the java process to lock the java process into memory? If so, how would the wrapper invoke the java program - fork/clone/vfork/execl?

Or maybe there is some other way to lock a java process into memory?

Thanks, Parik

JohnGraham 10-15-2010 03:25 AM

Quote:

Originally Posted by parikpol (Post 4127461)
...is it possible to write a C wrapper before invoking the java process to lock the java process into memory? If so, how would the wrapper invoke the java program - fork/clone/vfork/execl?

There are tutorials on the internet that will tell you how to start a JVM and such from C, but an easier solution might be to use the Java Native Interface (just Google it and you'll find loads of info) so you can call a function that calls mlock()/mlockall() from Java.


All times are GMT -5. The time now is 07:50 AM.