l****2 发帖数: 41 | |
g*****g 发帖数: 34805 | 2 why do you want to know?
【在 l****2 的大作中提到】 : rt
|
s*******u 发帖数: 19 | 3 Looks like there is a new api for this: http://java.sun.com/javase/6/docs/api/java/lang/instrument/Instrumentation.html#getObjectSize(java.lang.Object)
But it seems it is intended for tool makers. Google is always the way to
go.
【在 l****2 的大作中提到】 : rt
|
w*r 发帖数: 2421 | 4 serialize and save to database:D
【在 g*****g 的大作中提到】 : why do you want to know?
|
a**e 发帖数: 5794 | 5 既然存到数据库,打开看看不就知道有多大了?
【在 w*r 的大作中提到】 : serialize and save to database:D
|
g*****g 发帖数: 34805 | 6 You can write any serialized object into byte array,
then you certainly know how big it is.
【在 w*r 的大作中提到】 : serialize and save to database:D
|
c*****t 发帖数: 1879 | 7 Hehe, this size would be quite different from the actual object
size. Since it would include String and other referened objects.
LZ needs to clarify.
【在 g*****g 的大作中提到】 : You can write any serialized object into byte array, : then you certainly know how big it is.
|
l****2 发帖数: 41 | 8 i want to find a way to monitor the heap usage
【在 g*****g 的大作中提到】 : why do you want to know?
|
g*****g 发帖数: 34805 | 9 That's not a good way, find a profiler.
【在 l****2 的大作中提到】 : i want to find a way to monitor the heap usage
|
b******y 发帖数: 9224 | 10 Okey, I did some research and find this for you:
http://www.jiansnet.com/question.html?qid=156 |