注释或关键字告诉垃圾收集器首先删除对象
Java中有一个注解或者关键字,告诉垃圾收集器在内存耗尽时先删除一些对象。
不幸的是我忘记了它的名字。你知道吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想我可以肯定地说你的记忆有误。您可能会想到 参考对象。
I think I'm safe in saying that your memory's in error. You may be thinking of reference objects.
我什至不知道你如何注释一个对象。注释是编译时的事情,而对象是运行时的事情。
也许您的意思是“如何注释一个类以告诉垃圾收集器在任何其他对象之前收集此类的对象”。
但我从未听说过这样的功能。
也许您正在考虑一些缓存逐出算法:
在这种情况下,请查看 EHCache 库。
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.