db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Lichtman <swa...@rcn.com>
Subject Re: Optimal tuple memory representation
Date Sun, 01 May 2005 07:18:41 GMT

>I'm wondering if creating java object for each tuple and let the gc do its
>work would be more performant than having a reusable ByteBuffer that contains
>many raw tuples?  What do you think?

When we created Derby (nee Cloudscape), object instantiation and garbage 
collection were still quite expensive. We decided it would be cheaper to 
re-use objects such as data values and rows - this would avoid the problem 
of creating and destroying large numbers of objects when scanning through 
tables and indexes. Since then the memory management in most JVMs has 
gotten smarter, and if we were to start from scratch today we might not put 
so much emphasis on object re-use. For example, we might make data values 
and rows immutable, which would simplify the design of certain other parts 
of the system (e.g. code generation, some store interfaces, etc.).

                        -        Jeff Lichtman
                                 Check out Swazoo Koolak's Web Jukebox at

View raw message