performance issue - hazelcast delete issue

57 views
Skip to first unread message

rzv...@gmail.com

unread,
May 10, 2023, 11:30:57 AM5/10/23
to Hazelcast
We would like to clear all the objects on the hazelcast node once we are done with the task so for that we are using delete API on the cache but have noticed that it still have lot of memory taken on the hazlecast Partition to store some kind of metadata of the cache being created.

What is right mechanism to delete all the references of the cache to save memory at the end of the task ?

I used reset API on MapServiceContext which does the job but we would like to understand more about reset API and is it the right approach to clear all references of the cahce along with cache metadata ?

Thanks

Ahmet Mircik

unread,
May 11, 2023, 11:50:15 AM5/11/23
to haze...@googlegroups.com
MapServiceContext is an internal api and subject to change anytime, you should not rely on it.
Which metadata do you see in memory after delete? And how do you do deletion?


--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/5de1f2c3-cfed-4639-8941-ad383f4d4d05n%40googlegroups.com.

This message contains confidential information and is intended only for the individuals named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version. -Hazelcast

rzv...@gmail.com

unread,
May 15, 2023, 1:12:24 PM5/15/23
to Hazelcast
Thanks for looking into it. 

I am making call to destroy API from IMap, and expecting clean of all references. I am attaching heap dump which has references of com.hazelcast.map.impl.PartitionContianer which has link to the map which I created and taking 915kb memory and when I call resetAPI call, I don't see references of this object in the memory footprint.

I understand, reset is an internal API so which API can do complete cleanup of my cache from the hazelcast ?

Thanks

ahmet mırçık

unread,
May 16, 2023, 11:22:48 AM5/16/23
to haze...@googlegroups.com
I cannot see a heap dump attached but IMap destroy should remove all associated references.
Which version do you use? And a reproducer if possible to have.



--
Ahmet Mırçık

rzv...@gmail.com

unread,
May 16, 2023, 6:45:24 PM5/16/23
to Hazelcast
Sorry forgot to attach heapdump. Actually file is too big, unable to upload. It is easy to reproduce. 

First heapdump (2ObjectsAddedAndDestroy.snapshot) when I created only 2 cache and then call destroy to get rid of it and second heapdump (250objectsAddedAndDestroy.snapshot) when I added 250 caches and then invoke destroy call.

2ObjectsAddedAndDestroy.snapshot - com.hazelcast.map.impl.PartitionContainer[271] 91728 1104
250objectsAddedAndDestroy.snapshot - com.hazelcast.map.impl.PartitionContainer[271] 111568 1104

Code snippet : 

ClientConfig clientConfig = new ClientConfig();
clientConfig.setClusterName("dev");
clientConfig.getNetworkConfig().addAddress("127.0.0.1:5701");

HazelcastInstance hz  = HazelcastClient.newHazelcastClient(clientConfig);

for(int i=1;i< 250; i++) {
IMap<String, TestTrade> map = hz.getMap("com.calypso.tk.domain.Test"+i);
map.put(String.valueOf(i), new TestTrade(BigInteger.valueOf(i)));
map.destroy();
}

import java.io.Serializable;
import java.math.BigInteger;

public class TestTrade implements Serializable{
private BigInteger bI= new BigInteger("1000");
public TestTrade(BigInteger b) {
this.bI=b;
}
}

rzv...@gmail.com

unread,
May 16, 2023, 6:58:27 PM5/16/23
to Hazelcast
I am using hazelcast version 5.1.3

ahmet mırçık

unread,
May 18, 2023, 11:34:37 AM5/18/23
to haze...@googlegroups.com
How do you verify that the remaining memory contains references from the destroyed maps? 
I ran your reproducer and couldn't reproduce the case.



--
Ahmet Mırçık
Reply all
Reply to author
Forward
0 new messages