崩溃发生在Java虚拟机以外的本机代码中 [英] The crash happened outside the Java Virtual Machine in native code

查看:1475
本文介绍了崩溃发生在Java虚拟机以外的本机代码中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在具有32个虚拟处理器和32GB内存的Sun服务器上进行Web爬网.

I am doing web crawling on a Sun server with 32 virtual processors and 32GB memory.

我打开了1460个线程来为我完成这项工作.我设置的运行时参数为-Xms2048-Xmx2048.我已经运行了两次代码,但是在不同点崩溃了.

I opened 1460 threads to do the job for me. The runtime parameters I set were -Xms2048 and -Xmx2048. I have run the code twice, but it crashed at different points.

> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> #  SIGSEGV (0xb) at pc=0xff390f38, pid=3053, tid=7640
> #
> # JRE version: 6.0_15-b03
> # Java VM: Java HotSpot(TM) Server VM (14.1-b02 mixed mode solaris-sparc )
> # Problematic frame:
> # C  [libc_psr.so.1+0xf38]  memset+0x78
> #
> # If you would like to submit a bug report, please visit:
> #   http://java.sun.com/webapps/bugreport/crash.jsp
> # The crash happened outside the Java Virtual Machine in native code.
> # See problematic frame for where to report the bug.
> #
> 

我将线程数减少到40,并在同一服务器上运行它.当RSS的值超过Swap的值(两者均在2150M左右)时,它再次崩溃.换句话说,当内存超出限制时它崩溃了.然后,我在带有4G RAM和双核处理器的PC上运行它.令我惊讶的是,到目前为止,它一直表现良好. PC上的内存使用率保持在1.5G左右,离限制还很远.它运行如此稳定,以至于PC上似乎有一种机制可以防止内存达到其极限.相反,它似乎在Sun服务器上失控了.

I reduced the number of threads to 40 and ran it on the same server. It crashed again at the point the value of RSS exceeded the value of Swap(both of which were around 2150M). In other words, it crashed when the memory went beyond the limit. Then I ran it on my own PC with 4G RAM and dual core processor. To my surprise, it has been doing well so far. The memory usage on the PC is kept around 1.5G and a little far from the limit. It has been so steadily running that it seems there is a mechanism on the PC that prevents the memory from reaching its limit. In contrast, it seemed to go out of control on the Sun server.

自从我升级到最新的64位Java以来​​,到目前为止还没有崩溃.

It hasn't crashed so far since I upgraded to the latest 64-bit Java.

推荐答案

您是否尝试过将'M'附加到内存参数? (即-Xms2048M)另外,如果VM无法为堆保留足够的空间,我会尝试将ms设置为较小的值(即1024M).

Have you tried appending an 'M' to memory parameters? (i.e. -Xms2048M) Also, I would try setting ms to a smaller value (i.e. 1024M) in case the VM can't reserve enough space for the heap.

这篇关于崩溃发生在Java虚拟机以外的本机代码中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆