문제

I need Lru cache to store several (~100) huge object (~10MB for example). I read about Ehcache and JSC and have one question. I have the case: I store 10 object in ehcache. Then i get one from them and assign to reference. Whether data in my reference object and cache are duplicated or indicate to the same object in JVM memory?

도움이 되었습니까?

해결책

If you only create a new reference pointing to your large object, new object is not created.

You can easily prove this by putting a logging statement in all object constructors.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top