LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-14-2010, 12:58 PM   #1
parikpol
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Rep: Reputation: 0
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
 
Old 10-15-2010, 03:25 AM   #2
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by parikpol View Post
...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.
 
  


Reply

Tags
java



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible that java process without memory detail in proc file system geddysekar Linux - Kernel 1 05-17-2010 12:52 AM
Is it possible that java process without memory detail in proc file system geddysekar Linux - General 1 05-13-2010 08:55 AM
Java Linux Process memory footprint with and without -Xmx rolandofghent Linux - General 5 09-27-2007 09:08 AM
Java process memory space 32/64 Woody Benot Red Hat 0 06-06-2007 04:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration