Hi,

I wrote that "soft references doesn't make sense" but I was wrong... I
always mix up weak and soft references... I believe _weak_ references
don't make sense.

I have now integrated your patch (it is committed to the trunk). I
made a few changes:

I combined both settings into the cache type (CACHE_TYPE=LRU, TQ,
SOFT_LRU, SOFT_TQ). The prefix WEAK_ is also implemented but not
documented. I read again the WeakReference / SoftReference
documentation and it looks like it doesn't make sense to support it,
but it's only a few lines of code, so that's OK. If you find out that
it helps please tell me.

New system property h2.cacheTypeDefault (default: LRU).

I simplified the code to generate the Cache object and moved it to
CacheLRU (I want to avoid creating a new class CacheFactory).

I have re-implemented the SoftHashMap. I think it doesn't make sense
to wrap the (Integer) key in a SoftReference. You want the garbage
collector to throw away the rows (values), not the keys, because the
values need much more memory. You wrote your implementation was
running out of memory, probably that was why. See also:
http://www.roseindia.net/javatutorials/implementing_softreference_based_hashmap.shtml

Thanks again for your help!

Regards,
Thomas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to