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

Ask Your Question

SpaceMemoryShortageException - memory calculation


could you advice/recommend the proper way to calculate shared memory to prevent SpaceMemoryShortageException during running my application?

Also is there any way how to configure XAP to prevent this exception in future even if it affects performance e.g. some space swapping, etc? I am curious especially about situation I will run e.g. time consuming job which will take 4-5 days to finish and would like to prevent getting this exception e.g. 4th day. So is there any way to force GS to finish the processing only with available memory without interruption?

Thanks in advance


asked 2014-06-10 01:34:05 -0500

Peter gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

Careful capacity planning is a key to any successful deployment of In-Memory based technology. Having 100% memory capacity headroom is not unusual.

The space object footprint within the IMDG is determined based on:

  • The original object size - the number of object fields and their content size.
  • The JVM type (32 or 64 bit) - a 64 bit JVM might consume more memory due to the pointer address size.
  • The number of indexed fields - every indexed value means another copy of the value within the index list.
  • The number of different indexed values - more different values (uniform distribution) means a different index list per value.
  • The object UID size - the UID is a string-based field, and consumes about 35 characters. You might have the object UID based on your own unique ID. The actual footprint depends on the amount of indexed fields and the data distribution. Each index consumes:

120 Bytes + index value size + (number of object instances with this indexed value X 16)

To lower the chance getting into SpaceMemoryShortageException :

  • Adjust the memory manager settings to provide higher amplitude between low_watermark_percentage and high_watermark_percentage/write_only_block_percentage threshold.
  • have space-config.engine.memory_usage.gc-before-shortage turned on. This might impact the performance.
  • have space-config.engine.memory_usage.explicit-gc turned on. This might impact the performance.
  • Increase the heap size. Having 30G heap size becomes to norm with many systems.

See more: http://docs.gigaspaces.com/xap97/memo...



answered 2014-06-10 05:03:35 -0500

shay hassidim gravatar image
edit flag offensive delete link more

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: 2014-06-10 01:34:05 -0500

Seen: 2,397 times

Last updated: Jun 10 '14