Re: Cache or memory pools in java
- From: bcd@xxxxxxxxxxx (Bent C Dalager)
- Date: Wed, 23 May 2007 11:41:33 +0000 (UTC)
In article <1179858157.928003.256100@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
prasanna <prasanna81982@xxxxxxxxxxx> wrote:
There is another approach where you can serialize an object and
calculate its size. It does not guarantee the exact size but can get
you closer.
My recent experience with serialization is that what was 700 bytes
serialized using the default implementation took only 50 bytes or so
after I wrote my own custom serialization for the same objects. (This
matters to me because I want to fit it into one single UDP packet and
about 500 bytes seems to be the suggested maximum payload.)
What I left out, I expect, was administrative data for the objects
contained within the topmost object (and most of the administrative
data for the topmost object itself). My custom method would just write
the floats, ints, etc., contained in each nested object to an
ObjectOutputStream rather than write the actual objects themselves.
I expect my custom serialization is a more accurate estimate of the
in-memory cost of these objects than what the default serialization
was. The accuracy of the approach you suggest will therefore depend
entirely upon how the data objects in question are structured: if
there is much administrative data to be serialized, your estimate
could easily be off by a factor 10.
Cheers
Bent D
--
Bent Dalager - bcd@xxxxxxx - http://www.pvv.org/~bcd
powered by emacs
.
- References:
- Cache or memory pools in java
- From: Dlugi
- Re: Cache or memory pools in java
- From: B
- Re: Cache or memory pools in java
- From: prasanna
- Cache or memory pools in java
- Prev by Date: Re: Cache or memory pools in java
- Next by Date: Re: JNIEnv *
- Previous by thread: Re: Cache or memory pools in java
- Next by thread: mpeg-still
- Index(es):
Relevant Pages
|