由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - How to know the size of a java object ?
相关主题
请问一个serialize class object下载运行的问题any free or trial JVM optimizer??
Object stream & serilization有啥用处?问个Object.hashCode()的问题
how to multicast objects to clients in java?问一个GC的问题
要将数据同时生成JSON和XML, 应该先生成哪个,再转换成另一个Re: 谁有Java或Oracle的毒招 ?
what's inside an java object?Java中如何动态生成对象
怎样吧byte[]变成java.security.Key?一个Java程序员的话(3)
这段实例化的代码可以优化提速吗?copy constructor都什么时候be called啊
how to copy an Object?How to represent n:n relationship in Java?
相关话题的讨论汇总
话题: object话题: size话题: know话题: java话题: find
进入Java版参与讨论
1 (共1页)
l****2
发帖数: 41
1
rt
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
1 (共1页)
进入Java版参与讨论
相关主题
How to represent n:n relationship in Java?what's inside an java object?
About TreeMap in Java怎样吧byte[]变成java.security.Key?
Java里面有没有可能写个带generic parameter的class对built-in type也适用?这段实例化的代码可以优化提速吗?
Java复制objecthow to copy an Object?
请问一个serialize class object下载运行的问题any free or trial JVM optimizer??
Object stream & serilization有啥用处?问个Object.hashCode()的问题
how to multicast objects to clients in java?问一个GC的问题
要将数据同时生成JSON和XML, 应该先生成哪个,再转换成另一个Re: 谁有Java或Oracle的毒招 ?
相关话题的讨论汇总
话题: object话题: size话题: know话题: java话题: find