Hi everyone.
I'm currently implementing a Cache system.
Limiting its capacity with the number of object makes no sense, since
objects can have any size they want.
So I'd like to limit its capacity in term of number of bytes allready
cached. Therefore, I need to know what is the size in byte of any
object in the heap.
I thought about serializing the object to an array of byte, but this
method implies that the user is forced to make its objects serializable,
which is neither practical, nor kind to him or her.
Furthermore, serializing objects just to know their size in byte is
not efficient.
Is there a way to do this in a simple and elegant way ?
Thanks for your answers.
Jérôme.
--
--
He's just a politician trying to save both his faces...
----------------------------
jerome.eteve_at_it-omics.com