
Signature
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth
BTW, I am using the JDK 1.4.2.
I tried to tried to implement SoftReferences just now but it didn't
seem to work. However, I don't think I did it right. I created a
SoftReference and put it into the Vector and then set the large
object that I create the SoftReference for to null. I still got an
OutOfMemoryException.
What do you mean I "will need to download the soft compiler version?
Thanks,
Joe
Wibble - 01 Apr 2006 17:57 GMT
> BTW, I am using the JDK 1.4.2.
>
[quoted text clipped - 8 lines]
> Thanks,
> Joe
You should get a profiler like optimizeIt or JProbe and find out
what your leak really is. Its probably not what you think.
You can get a free 30 days of either.
Larry Barowski - 02 Apr 2006 00:30 GMT
> You should get a profiler like optimizeIt or JProbe and find out
> what your leak really is. Its probably not what you think.
>
> You can get a free 30 days of either.
Or get Java 1.6 and use jmap and jhat.
Wibble - 01 Apr 2006 17:59 GMT
> BTW, I am using the JDK 1.4.2.
>
[quoted text clipped - 8 lines]
> Thanks,
> Joe
Also, check your process size. Sometimes you get OOM errors
when you exceed stack size or allocate buffers with size of
Integer.MAX_VALUE or something. Run it in jdb and catch OOM Error.
steve - 01 Apr 2006 22:32 GMT
> BTW, I am using the JDK 1.4.2.
>
[quoted text clipped - 8 lines]
> Thanks,
> Joe
sorry could not resist.
instead of using the removeAll(), just redefine the vector using the same
name or set it to null when you have finished.
It works, and so will the GC, unless you did something really silly.
Another trick to use , is instead of sticking your objects into a vector,
write the objects out to temp files , then store the file names in a hash
map (just do it in a background thread), I use this system for displaying
scanned document pages, and it really is quite fast.
be clear what a soft reference is, it can be just as dangerous as a "hard"
ref, when used wrongly and will not always guarantee that you will get rid
of the OutOfMemoryException.
seve

Signature
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth