Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Memory usage in XAP6.6


I'm trying to create intelligent Feeder which will be loading data to cache based on current space memory usage. I want to make feeder to slow down in case when there is only 1GB of memory left in space and stop in situation when there is only 512MB of space memory left. Due to the fact that my own computations are automatically removing processed data from space, memory in space should be freeing in time. Feeder should be automatically resumed when there is 1GB of free memory in space. The question is how to do it in XAP 6.6? I was looking for such information in documentation and I couldn't find anything useful. Is such information accessible from XAP API? or maybe I should retrieve memory usage using "Runtime" of each VM in cluster manually and sum the results?

Best regards, Stan

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=3001]{quote}

asked 2009-04-07 05:11:36 -0500

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted


The memory management facility can help you achieve your goal.
In short, you can define memory thresholds that when reached report back
to the client by throwing MemoryShortageException. Once the exception is
thrown you control the client's behavior.

For more information, please refer to:


answered 2009-04-07 06:10:00 -0500

nirpaz gravatar image
edit flag offensive delete link more

Hi, thank you for reply. I have tried to do that this way using MemoryShortageException exception however it doesn't give me the flexibility which I need. However as I understand the decision to throw this Exception is made based on some variable which is stored somewhere in GS, the question is how to read this variable? The example which I gave is maybe to complex, simpler would be: Which variable should I use if I want to draw total free memory which can be used to store objects in cache?

Best regards, s.

answered 2009-04-07 06:34:25 -0500

edit flag offensive delete link more



The memory manager uses JVM statistics to get analyze memory usage. As of R7.0, all this information is exposed using the Admin API.

I'm curious to the level of flexibility you're looking for, is it because the MM works in relational model, giving flexibility in percentages and not actual megabytes?

nirpaz gravatar image nirpaz  ( 2009-04-07 06:49:00 -0500 )edit

Uh, so I have to do that manually. It however would be very nice to be able to determine how much space is available for objects in easy way. My calculation process computes a lot of data and due to that it is easy to exceed available memory. The best way to achieve protection from this is by slowing down the feeder which is acceptable. Doing this using try...catch I don't consider as good and clean solution.

Best regards, s.

staszek gravatar image staszek  ( 2009-04-07 07:36:07 -0500 )edit

I donno but it might be worth playing with SLA's

You can have PU SLA to deploy on a specific container (use platformcapabilities) and use memory SLA to enable and disable PU based on memory usage on that space.


venkatg gravatar image venkatg  ( 2009-04-07 10:52:55 -0500 )edit

Very simple way to get the JVM stats from all primary partitions is to use the Executor with a simple Task implementation which return the JVM stats back into the caller.


shay hassidim gravatar image shay hassidim  ( 2009-04-07 11:06:03 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2009-04-07 05:11:36 -0500

Seen: 79 times

Last updated: Apr 07 '09