There is an annotation or a keyword in Java that tells the garbage collector to remove some objects first when the memory is running out.
Unfortunately I've forgotten it's name. Do you know it?
I think I'm safe in saying that your memory's in error. You may be thinking of reference objects.
I can't even see how you would annotate an object. Annotations are a compile time thing and objects are a runtime thing.
Perhaps you meant to say something like "how do I annotate a class to tell the garbage collector to collect objects of this class before any other objects".
I've never heard of such feature though.
Perhaps you're thinking of some cache eviction algorithms:
In that case, have a look at the EHCache library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With