Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Unicode forms for internal storage&In-Reply-To=20030420212424.77D5824AEB6@mail.ibiblio.org

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: DHollenbeck <dick AT softplc.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Unicode forms for internal storage&In-Reply-To=20030420212424.77D5824AEB6 AT mail.ibiblio.org
  • Date: Wed, 21 Jan 2004 12:58:44 -0600

I have written a JVM myself. From that experience I found that the memory overhead of any Java Object, as it exists in the implementing C/C++ code, is a significant factor of the total memory a Java program will use.

This is especially true when you have lots of small Java Objects. In XML, often we are dealing with strings less than about 20 characters. Therefore, anything that can be done to reduce Java Object count is good.

On this basis, I would think that an object of this type is optimal speed/size tradeoff:

char[]

Yes, just a char[] array. One that can be passed to the String() constructor.

Also, at some point I would have incorporated the embedded ArrayList object's functionality that you have in your Node hierarchy into the parent Node class itself. You'll get both speed and memory pickup doing this.
i.e. make your Node (or whatever the parent class is) incorporate the [customized] functionality of ArrayList into its methods such that you no longer need to include ArrayList as a member. You will reduce the Java Object count by the number of Nodes in the XML document, this means less memory, faster instantiation time, etc.


Dick Hollenbeck






Archive powered by MHonArc 2.6.24.

Top of Page