I am using a dual core XP machine with 4GB memory installed (but only 2.5GB reported by the OS due to the 32bit fact). I am actively modifing an old JAVA application for at least a month by using lastest Eclipse (edit, build and run) and Ant (another way to build and run). In the Eclipse run configuration and build.xml file, we have the following JVM parameters: -Xmx1024M -Xms1024M -Xmn384M
. We have been using this configuration for years.
我使用的是安装了4GB内存的双核XP机器(但由于32位事实,操作系统仅报告了2.5GB)。我通过使用最新的Eclipse(编辑,构建和运行)和Ant(另一种构建和运行方式)来主动修改旧的JAVA应用程序至少一个月。在Eclipse运行配置和build.xml文件中,我们有以下JVM参数:-Xmx1024M -Xms1024M -Xmn384M。我们多年来一直在使用这种配置。
I also have a batch file to launch Eclipse with this parameter: -vmargs -Xmx768M
. This batch file has been with me for years. (now I changed to modify the eclipse.ini to do configuration.)
我还有一个批处理文件,用这个参数启动Eclipse:-vmargs -Xmx768M。这个批处理文件已经和我在一起多年了。 (现在我改为修改eclipse.ini进行配置。)
The day before yesterday, I found it was much slower when I used Ant to build and run my application (I build and run it frequently during the modification process). I restarted my machine just before I went home. That night I VPN to my machine to finish some modifications (I am a very good employee.) and found more slower. Next morning, "could not craete the Java Virtual Machine" started to happen when I run our application with Ant.
前天,我发现使用Ant构建和运行我的应用程序时速度要慢得多(我在修改过程中经常构建并运行它)。我回家之前就重新启动了机器。那天晚上我通过VPN连接我的机器来完成一些修改(我是一名非常优秀的员工。)并且发现速度更慢。第二天早上,当我使用Ant运行应用程序时,“无法让Java虚拟机疯狂”开始发生。
I restarted my machine. Then I couldn't start my Eclipse with the same error. I have to change the vmargs to claim only 512MB memory to launch the Eclipse. The build time with Ant increased from about 20 seconds to about 6 minutes. And I have to decrease the max memory for JVM to
我重新启动了我的机器。然后我无法用同样的错误启动我的Eclipse。我必须更改vmargs以声称只有512MB内存才能启动Eclipse。 Ant的构建时间从大约20秒增加到大约6分钟。而且我必须减少JVM的最大内存
-Xmx512M -Xms512M
in both Eclipse run configuration and Ant build.xml in order to avoid error.
在Eclipse运行配置和Ant build.xml中都是为了避免错误。
Then I uninstall my 1.6u24 jdk/jre and installed the 1.6u25. I reinstalled the Eclipse. Scanned the entire machine with Trend Micro and found nothing.
然后我卸载我的1.6u24 jdk / jre并安装了1.6u25。我重新安装了Eclipse。使用趋势科技扫描整个计算机,一无所获。
Another machine which I usually connect to do some testing has similar result (slower). All other machines, include my co-worker's machine and my laptop, work fine with the same application and tools.
我通常连接到另一台机器进行一些测试也有类似的结果(较慢)。所有其他机器,包括我的同事的机器和我的笔记本电脑,使用相同的应用程序和工具正常工作。
If I use Ant to build and run it, the build process and launch process are extramely slow. I have created two batch files to compile and launch my application . They work as normal. When compile with Eclipse, it works as normal. But I cannot ask JVM to claim 1024MB for my application in all cases now.
如果我使用Ant来构建和运行它,那么构建过程和启动过程都非常慢。我创建了两个批处理文件来编译和启动我的应用程序。他们正常工作。使用Eclipse编译时,它可以正常工作。但我现在不能要求JVM为我的应用程序申请1024MB。
All other activities on my machine seem normal. VisualStudio and C# application work as usual. My machine was rebuilt few weeks ago due to hard disk failure. So there are no many useless things to slow my machine down.
我机器上的所有其他活动似乎都很正常。 VisualStudio和C#应用程序照常工作。由于硬盘故障,几周前我的机器重建了。所以没有太多无用的东西可以减慢我的机器速度。
Anybody can help me figure out why the JVM on my machine changed its behaviour? I hope it is not caused by virus. Do you know anything I can try before I call IT to rebuild my machine?
任何人都可以帮我弄清楚为什么我机器上的JVM改变了它的行为?我希望它不是由病毒引起的。在我打电话给IT重建我的机器之前,你知道我能尝试什么吗?
thanks,
4 个解决方案
#1
6
While your configuration might not have changed, that doesn't mean that the amount of available memory hasn't changed. Memory is used by all programs in the operating system, so if another program has a slightly larger use of memory, it might not be possible to pre-assign the 1GB of memory you indicated (from the command line arguments) must be available to start the JVM.
虽然您的配置可能没有更改,但这并不意味着可用内存量没有改变。内存被操作系统中的所有程序使用,因此如果另一个程序的内存使用量稍大,则可能无法预先分配您指定的1GB内存(来自命令行参数)必须可用于启动JVM。
Another possibility is that some new program is installed / running, and it is absconding with the memory you need. Virus scanning might have been installed / updated, and it alone can be quite a memory hog (depending on the product).
另一种可能性是安装/运行了一些新程序,它与您需要的内存潜逃。病毒扫描可能已经安装/更新,仅此一项就可能非常耗费内存(取决于产品)。
Finally, you mentioned that the machine was rebuilt. You might want to verify (via BIOS) that you actually have the same amount of physical memory you had prior to the rebuild. Rebuilding machines has a funny way of jarring memory sticks out of their sockets (or perhaps there was more rebuilding going on than meets the eye). The issue could be as simple as there's not enough memory to pre-assign to the JVM because you are starting with less.
最后,您提到机器已重建。您可能希望(通过BIOS)验证您实际上具有与重建之前相同的物理内存量。重建机器有一种有趣的方式,可以将记忆棒从插座中扯出来(或者可能还有更多的重建工作,而不是眼睛)。问题可能很简单,因为没有足够的内存来预先分配给JVM,因为你从较少开始。
If all of that checks out, check the obscure stuff. If you reinstalled a very old or different operating system, it might not support accessing as much memory as is installed. This commonly occurs when someone is reverted from a 64 bit installation down to a 32 bit installation.
如果所有这些检查出来,请检查一些模糊不清的东西。如果重新安装了一个非常旧的或不同的操作系统,它可能不支持访问所安装的内存。当有人从64位安装恢复到32位安装时,通常会发生这种情况。
#2
1
Either use the task manager or process explorer from microsoft (http://technet.microsoft.com/en-us/sysinternals/bb896653) and check for memory hogs. If you have to reduce the amount of memory you are using, chances are it is because something else has taken it up. Also, I find the cap at 2.5GB a bit odd, as I thought the cap was more like 3.25GB (mostly because this is what I have on my windows XP with 4gb installed).
使用Microsoft的任务管理器或进程资源管理器(http://technet.microsoft.com/en-us/sysinternals/bb896653)并检查内存耗尽。如果你必须减少你正在使用的内存量,那么可能是因为其他东西已经占用了它。此外,我发现2.5GB的上限有点奇怪,因为我认为上限更像是3.25GB(主要是因为这是我安装4gb的Windows XP上的内容)。
Also, every time I've seen that error message it is because there isn't enough physical memory available to grab. I've had to close programs in the past in order to run a few things after getting this exception.
此外,每次我看到该错误消息都是因为没有足够的物理内存可供抓取。我不得不在过去关闭程序,以便在获得此异常后运行一些东西。
(I would have put this in a comment, but don't have the rating yet :/ )
(我会把它放在评论中,但还没有评级:/)
#3
0
Can you see anything odd in the task manager? CPU utilization? The fact that you can't allocate as much memory as you used to sounds odd, but I have seen similar decrease in compilation times after an upgrade of the antivirus on one of my development machines.
你能在任务管理器中看到奇怪的东西吗? CPU利用率?事实上你不能分配尽可能多的内存听起来奇怪,但我看到在我的一台开发机器上升级防病毒后,编译时间也有类似的减少。
What happens if you disable antivirus while you do a compilation?
如果在编译时禁用防病毒软件会发生什么?
#4
0
It sounds more like a configuration issue than a virus, especially considering that it was rebuilt recently.
You didn't mention whether you are using 32-bit or 64-bit Java. It might help to know which one is trying to run when it fails.
这听起来更像是一个配置问题,而不是病毒,特别是考虑到它最近被重建。您没有提到您使用的是32位还是64位Java。知道哪一个在失败时试图运行可能会有所帮助。
Other things to check: virtual memory settings; any application-specific settings in the OS; anti-virus program settings; other processes (try running HijackThis and/or MSRT).
其他要检查的事项:虚拟内存设置;操作系统中任何特定于应用程序的设置;反病毒程序设置;其他进程(尝试运行HijackThis和/或MSRT)。
#1
6
While your configuration might not have changed, that doesn't mean that the amount of available memory hasn't changed. Memory is used by all programs in the operating system, so if another program has a slightly larger use of memory, it might not be possible to pre-assign the 1GB of memory you indicated (from the command line arguments) must be available to start the JVM.
虽然您的配置可能没有更改,但这并不意味着可用内存量没有改变。内存被操作系统中的所有程序使用,因此如果另一个程序的内存使用量稍大,则可能无法预先分配您指定的1GB内存(来自命令行参数)必须可用于启动JVM。
Another possibility is that some new program is installed / running, and it is absconding with the memory you need. Virus scanning might have been installed / updated, and it alone can be quite a memory hog (depending on the product).
另一种可能性是安装/运行了一些新程序,它与您需要的内存潜逃。病毒扫描可能已经安装/更新,仅此一项就可能非常耗费内存(取决于产品)。
Finally, you mentioned that the machine was rebuilt. You might want to verify (via BIOS) that you actually have the same amount of physical memory you had prior to the rebuild. Rebuilding machines has a funny way of jarring memory sticks out of their sockets (or perhaps there was more rebuilding going on than meets the eye). The issue could be as simple as there's not enough memory to pre-assign to the JVM because you are starting with less.
最后,您提到机器已重建。您可能希望(通过BIOS)验证您实际上具有与重建之前相同的物理内存量。重建机器有一种有趣的方式,可以将记忆棒从插座中扯出来(或者可能还有更多的重建工作,而不是眼睛)。问题可能很简单,因为没有足够的内存来预先分配给JVM,因为你从较少开始。
If all of that checks out, check the obscure stuff. If you reinstalled a very old or different operating system, it might not support accessing as much memory as is installed. This commonly occurs when someone is reverted from a 64 bit installation down to a 32 bit installation.
如果所有这些检查出来,请检查一些模糊不清的东西。如果重新安装了一个非常旧的或不同的操作系统,它可能不支持访问所安装的内存。当有人从64位安装恢复到32位安装时,通常会发生这种情况。
#2
1
Either use the task manager or process explorer from microsoft (http://technet.microsoft.com/en-us/sysinternals/bb896653) and check for memory hogs. If you have to reduce the amount of memory you are using, chances are it is because something else has taken it up. Also, I find the cap at 2.5GB a bit odd, as I thought the cap was more like 3.25GB (mostly because this is what I have on my windows XP with 4gb installed).
使用Microsoft的任务管理器或进程资源管理器(http://technet.microsoft.com/en-us/sysinternals/bb896653)并检查内存耗尽。如果你必须减少你正在使用的内存量,那么可能是因为其他东西已经占用了它。此外,我发现2.5GB的上限有点奇怪,因为我认为上限更像是3.25GB(主要是因为这是我安装4gb的Windows XP上的内容)。
Also, every time I've seen that error message it is because there isn't enough physical memory available to grab. I've had to close programs in the past in order to run a few things after getting this exception.
此外,每次我看到该错误消息都是因为没有足够的物理内存可供抓取。我不得不在过去关闭程序,以便在获得此异常后运行一些东西。
(I would have put this in a comment, but don't have the rating yet :/ )
(我会把它放在评论中,但还没有评级:/)
#3
0
Can you see anything odd in the task manager? CPU utilization? The fact that you can't allocate as much memory as you used to sounds odd, but I have seen similar decrease in compilation times after an upgrade of the antivirus on one of my development machines.
你能在任务管理器中看到奇怪的东西吗? CPU利用率?事实上你不能分配尽可能多的内存听起来奇怪,但我看到在我的一台开发机器上升级防病毒后,编译时间也有类似的减少。
What happens if you disable antivirus while you do a compilation?
如果在编译时禁用防病毒软件会发生什么?
#4
0
It sounds more like a configuration issue than a virus, especially considering that it was rebuilt recently.
You didn't mention whether you are using 32-bit or 64-bit Java. It might help to know which one is trying to run when it fails.
这听起来更像是一个配置问题,而不是病毒,特别是考虑到它最近被重建。您没有提到您使用的是32位还是64位Java。知道哪一个在失败时试图运行可能会有所帮助。
Other things to check: virtual memory settings; any application-specific settings in the OS; anti-virus program settings; other processes (try running HijackThis and/or MSRT).
其他要检查的事项:虚拟内存设置;操作系统中任何特定于应用程序的设置;反病毒程序设置;其他进程(尝试运行HijackThis和/或MSRT)。