transient java object instance from jvm through jni?

Hello, All

Sometimes I want manage the memory take by object instance,

for example, If I want to design a cache which cache a huge number object.

Then, there may two problems:

1, May occur OutOfMemory error.

2, I want like to manually reclaim the memory take by the cached object,

not by gc, because it may take a little time to check the reference for gc.

Just as you know, there is keywordtransient for serialization.

I want know if some same mechanism for object instance creating or release, managing memory by jni, or by some other way?

[611 byte] By [lihy70a] at [2007-11-27 5:54:11]
# 1
No, since you're not supposed to do that. hence you can't really expect Java to provide the means...Maybe you can use classes like WeakReference etc. but that won't bypass GC.
CeciNEstPasUnProgrammeura at 2007-7-12 15:48:24 > top of Java-index,Java Essentials,Java Programming...