由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - java小弱请教 java -Xmx40960m
相关主题
关于java执行SQL之后的内存问题?How to know the size of a java object ?
求教有没有好的查memory leak的工具?Monitor Probe: javamelody,DTrace,spf4j,jamon,javasimon,jrobin,visualVM?
VisualVM profiler,有朋友用过么Re: 怎么能是JAVA里的数组开的更大?
Where I can find comparison of JVMs问个很简单的问题?
Java是如何处理ArrayList和LinkedList的内存的?help about bitstream writer
out heap memory怎样吧byte[]变成java.security.Key?
JBoss 4.0.4 is slow down in every 20 days怎麼得到字符串中的raw bytes?
help for running CPU intensive program!!How to parse the bytes[]
相关话题的讨论汇总
话题: heap话题: java话题: visualvm话题: xmx40960m话题: 小弱
进入Java版参与讨论
1 (共1页)
l****n
发帖数: 55
1
遇到 java.lang.OutOfMemoryError: Java heap space
然后开始调 Xmx 从512m一直调到 40960m
我和我的小伙伴都惊呆了。。。请教这是怎么回事,谢谢
l****n
发帖数: 55
2
以及把Xmx设得这么大会影响速度吗
m****r
发帖数: 6639
3
你要先搞清楚这个memory用到哪里去了。 40g肯定是不正常了。 是一上来就有error
, 还是跑一会再有。 用profiler看看。 基本是有leak了。

【在 l****n 的大作中提到】
: 遇到 java.lang.OutOfMemoryError: Java heap space
: 然后开始调 Xmx 从512m一直调到 40960m
: 我和我的小伙伴都惊呆了。。。请教这是怎么回事,谢谢

w**z
发帖数: 8232
4
take a heap dump .

【在 l****n 的大作中提到】
: 遇到 java.lang.OutOfMemoryError: Java heap space
: 然后开始调 Xmx 从512m一直调到 40960m
: 我和我的小伙伴都惊呆了。。。请教这是怎么回事,谢谢

t*******e
发帖数: 684
5
Does it really have 40G physical memory? Heap dump file at that size would
take forever to open. Try VisualVM to profile your app.
l****n
发帖数: 55
6
Yea, I follow your suggestion and open VisualVM-heapdump, but I don't know
how to detect the problem. Could you be more specific? Thank you so much

【在 t*******e 的大作中提到】
: Does it really have 40G physical memory? Heap dump file at that size would
: take forever to open. Try VisualVM to profile your app.

e*****t
发帖数: 1005
7
I am really surprised to see your application need 40GB heap, and you starte
d with 512mb heap.
You should start with a small heap size (could be even smaller than 512mb),
run it, figure out where exactly the problem happened. You can start with st
acktrace, if that doesn't help, you can use visualvm to monitor what object
type is taking up all the memory.
google some online tutorial on troubleshooting memory leak.

【在 l****n 的大作中提到】
: Yea, I follow your suggestion and open VisualVM-heapdump, but I don't know
: how to detect the problem. Could you be more specific? Thank you so much

w**z
发帖数: 8232
8
try to open heap dump from eclipse MAT and start with leak report.

【在 l****n 的大作中提到】
: Yea, I follow your suggestion and open VisualVM-heapdump, but I don't know
: how to detect the problem. Could you be more specific? Thank you so much

t*******e
发帖数: 684
9
Not at 40GB size though. I'd recommend to set the heap size back to 512m,
and run VisualVM Profiler to track memory leaks.

【在 w**z 的大作中提到】
: try to open heap dump from eclipse MAT and start with leak report.
w**z
发帖数: 8232
10
definitely not to take heap dump at 40G. set back to 512m, You can set jvm -
XX:+HeapDumpOnOutOfMemoryError, so it will take a heap dump when it runs
into OOM

【在 t*******e 的大作中提到】
: Not at 40GB size though. I'd recommend to set the heap size back to 512m,
: and run VisualVM Profiler to track memory leaks.

相关主题
out heap memoryHow to know the size of a java object ?
JBoss 4.0.4 is slow down in every 20 daysMonitor Probe: javamelody,DTrace,spf4j,jamon,javasimon,jrobin,visualVM?
help for running CPU intensive program!!Re: 怎么能是JAVA里的数组开的更大?
进入Java版参与讨论
l****n
发帖数: 55
11
It's because I have a 50,000 * 50,000 integer matrix ....
I change integer into byte, it doesn't help much
Then I change matrix into LinkedList to avoid continuous allocating,
it cannot pass under -Xmx4g...

-

【在 w**z 的大作中提到】
: definitely not to take heap dump at 40G. set back to 512m, You can set jvm -
: XX:+HeapDumpOnOutOfMemoryError, so it will take a heap dump when it runs
: into OOM

e*****t
发帖数: 1005
12
50k*50k*4byte (integer)
~10000MB
~10GB
it's obviously too big. I don't know why you have such a big matrix, but you
m
ight need to take a look of other approaches. e.g. change your algorithm or
change your data structure if you want to handle it in one jvm.
Or you should go with parallel computing routes: for example, map-reduce, or
MPI.

allocating,

【在 l****n 的大作中提到】
: It's because I have a 50,000 * 50,000 integer matrix ....
: I change integer into byte, it doesn't help much
: Then I change matrix into LinkedList to avoid continuous allocating,
: it cannot pass under -Xmx4g...
:
: -

l****n
发帖数: 55
13
Yea, I just finished modifying the algorithm to avoid large matrix. Thank
you all

you
or
or

【在 e*****t 的大作中提到】
: 50k*50k*4byte (integer)
: ~10000MB
: ~10GB
: it's obviously too big. I don't know why you have such a big matrix, but you
: m
: ight need to take a look of other approaches. e.g. change your algorithm or
: change your data structure if you want to handle it in one jvm.
: Or you should go with parallel computing routes: for example, map-reduce, or
: MPI.
:

b******y
发帖数: 9224
14
一般java程序如果到了需要改default memory usage参数的地步,说明程序design的不
好。
w**z
发帖数: 8232
15
这个我不同意,gc 参数是要调的。

【在 b******y 的大作中提到】
: 一般java程序如果到了需要改default memory usage参数的地步,说明程序design的不
: 好。

l*******m
发帖数: 1096
16
LinkedList even worse than array

allocating,

【在 l****n 的大作中提到】
: It's because I have a 50,000 * 50,000 integer matrix ....
: I change integer into byte, it doesn't help much
: Then I change matrix into LinkedList to avoid continuous allocating,
: it cannot pass under -Xmx4g...
:
: -

1 (共1页)
进入Java版参与讨论
相关主题
How to parse the bytes[]Java是如何处理ArrayList和LinkedList的内存的?
generic 太长怎么办?out heap memory
帮我了解一下64bit JVMJBoss 4.0.4 is slow down in every 20 days
List, LinkedList and Vectorhelp for running CPU intensive program!!
关于java执行SQL之后的内存问题?How to know the size of a java object ?
求教有没有好的查memory leak的工具?Monitor Probe: javamelody,DTrace,spf4j,jamon,javasimon,jrobin,visualVM?
VisualVM profiler,有朋友用过么Re: 怎么能是JAVA里的数组开的更大?
Where I can find comparison of JVMs问个很简单的问题?
相关话题的讨论汇总
话题: heap话题: java话题: visualvm话题: xmx40960m话题: 小弱