Kavita Shinde
Kavita Shinde

Reputation: 11

Disk space occupied even after calling cleanup/cache remove apis from EhCache

We are using Ehcache version - 3.6.1 in out java application.

We are configuring Ehcache with following ResourcePoolsBuilder configuration:

heap: 10000
disk: 10 GB
offheap: not using 
OS - Linux

Accordingly, most of cache data gets stored in say /.../offheap-disk-store/ehcache-disk-store.data file. Assume ehcache-disk-store.data file size is around 15 gb.

Once we are done with cache usage, we cleanup cache as:

CacheManager.removeCache("cache name")
CacheManager.close();

What we have observed is, even after cache cleanup done from the application (as mentioned above), disk space is still occupied. Output of df -kh command still shows disk space being occupied.

Once we stop our java application, then only disk space is freed up.

Here is disk space usage: After java application start, but before EHcache creation:

Filesystem      Size   Used   Avail  
/dev/sda4       425G   276G   149G

After removing/cleaning up cache

Filesystem      Size   Used   Avail  
/dev/sda4       425G   283G   142G

After stopping my java application:

Filesystem      Size   Used   Avail
/dev/sda4       425G   276G   149G

I could only find following apis to cleanup the cache, which we have already called:

Ehcache.clear();
CacheManager.removeCache("cache name")
CacheManager.close();

So assuming all these apis are called, I am not understanding why disk space continues to be held up until application is stopped.

Can anyone please give some pointer? I didn't find any bugs filed related to that for EHCache.

Any suggestions/feedback is appreciated.

Upvotes: 0

Views: 33

Answers (0)

Related Questions