Question

Does anyone know of a way to check the size of objects stored in a gemfire cache? Or even the size of the regions themselves (in MB, rather than the number of objects they contain).

We're tweaking the makeup of some of our objects and I'd like to see what extra/less strain we're putting on the time it takes for Gemfire to serialize them and the size of the end product...

Cheers, Dave.

Was it helpful?

Solution

In case others tread this path, here are a couple of recently posted articles which may be relevant to this question:

Data Sizer Java Utility Class: http://communities.vmware.com/docs/DOC-20695

Perhaps, not specific enough, but still very useful is GemFire Memory Sizing Guidelines: http://communities.vmware.com/docs/DOC-20714

OTHER TIPS

It's maybe a bit late to answer to your question but you can try one of the following to get the size of your objects in the cache:

1) Use GFMon that you can download from the vmware website. It will tell you the size in bytes of each region.

2) Use the method CachedDeserializableFactory.calcSerializedMemSize(object), it will tell you the size of the object in memory after it has been serialized.

You need to be aware that your objects will not always be stored in serialized form in the cache. To force the objects to be serialized in the cache, you can use the system property gemfire.PREFER_SERIALIZED=true.

For example: java -Dgemfire.PREFER_SERIALIZED=true com.example.MyCacheServer

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top