JPPF, java, parallel computing, distributed computing, grid computing, parallel, distributed, cluster, grid, cloud, open source, android, .net
JPPF

The open source
grid computing
solution

 Home   About   Features   Download   Documentation   On Github   Forums 
June 04, 2023, 09:25:04 AM *
Welcome,
Please login or register.

Login with username, password and session length
Advanced search  
News: New users, please read this message. Thank you!
  Home Help Search Login Register  
Pages: [1]   Go Down

Author Topic: jppf memory management  (Read 1880 times)

mmingfeilam

  • Guest
jppf memory management
« on: May 19, 2015, 05:34:21 PM »

does jppf have any memory management mechanism other than jppf.jvm.options?  i have a RAM disk setup, which uses physical memory, but sometimes it looks like jppf runs out of memory and hangs.  ideally i want it to see what memory is available before running a task.  thanks. 
Logged

lolo

  • Administrator
  • JPPF Council Member
  • *****
  • Posts: 2272
    • JPPF Web site
Re: jppf memory management
« Reply #1 on: May 19, 2015, 07:04:39 PM »

Hello,

In almost every case, the memory (JVM heap) is mostly taken by the tasks executing in a node, rather than by the JPPF node itself. For information, an idle node connected to a server takes as low as 1.6 MB of heap, immediately after a full garbage collection. That is a very small footprint.

There are many ways to obtain or use the available heap of a node. A typical usage is via an execution policy in the job's SLA, using the available node runtime information. For example, a policy specifying that a job can only execute on a node with at least 2GB of available heap could be written like this:
Code: [Select]
JPPFJob job = new JPPFJob();
long GB = 1024L * 1024L * 1024L;
// execute on nodes with at least 2GB
job.getSLA().setExecutionPolicy(new AtLeast("freeMemory", 2 * GB));

You may also use the JMX-based monitoring API, in particular the JVM diagnostics/health MBean to have an up to date view of the heap and non-heap memory usage, along with other information such as CPU load etc...

If you want your tasks to know the currently available heap, you could use a simple function like this one:
Code: [Select]
public static long maxFreeHeap() {
  Runtime rt = Runtime.getRuntime();
  return rt.maxMemory() - (rt.totalMemory() - rt.freeMemory());
}

Sincerely,
-Laurent
Logged
Pages: [1]   Go Up
 
JPPF Powered by SMF 2.0 RC5 | SMF © 2006–2011, Simple Machines LLC Get JPPF at SourceForge.net. Fast, secure and Free Open Source software downloads