Sun's garbage collector has evolved such that an object cache can be harmful. This was not true a long time ago, thus you can find dated articles talking about the merits of using a cache. You probably should not assume that for Sun's GC, a large number of small allocations will necessarily harm performance.
On Thu, Apr 29, 2010 at 1:56 PM, James Gregurich <[email protected]>wrote: > I've been putting a lot of thought into the value system since it would be > creating a lot of relatively small objects. I can see malloc/free being hit > hard by this mechanism in C++. > > Question: > > in the case of multiple, in-memory db's with multiple threads accessing > them, would it be useful to give each 'Session' or 'Database' its own Value > object cache? > > > Also, it seems to me (atleast in C++-land) that the 'Value' system to be a > good candidate to put on a memory pool rather than going through new/delete. > Any thoughts on that? > > -James > > On Apr 29, 2010, at 11:24 AM, Thomas Mueller wrote: > > > Hi, > > > >> I'm studying the Value object cache mechanism. I would appear to me that > multiple databases in one process would be sharing the static Value object > cache on multiple threads. What keeps access to this cache serialized? > > > > Nothing keeps it synchronized currently. A different thread will > > either see the old value, null, or the new value. This shouldn't be a > > problem. Updating references (pointers) in Java is not necessarily > > done in order, but it is atomic (otherwise it would be a security > > problem). > > > > 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]<h2-database%[email protected]> > . > > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. > > > > -- > 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]<h2-database%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. > > -- 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.
