ntysdd
ntysdd

Reputation: 1264

How CMS decides when to collect SoftReferences?

I wrote a memory sensitive cache using soft references.

At first it worked well, but after a few days, memory pressure went high, then suddenly dropped.

Well, this is expected, I want to the cache to hold data as long as possible but not so long to cause out-of-memory. Kind of graceful degradation.

But from then, it didn't work so well. I find somehow it has become dropping data more aggressively.

The question is, does the JVM somehow tune itself adaptively and decides to drop SoftReference more aggressively?

Upvotes: 0

Views: 50

Answers (0)

Related Questions