“无法创建 Java 虚拟机”是病毒引起的还是机器出问题了?

发布于 2024-11-08 13:36:34 字数 1394 浏览 0 评论 0原文

在此处输入图像描述

我使用的是双核 XP 计算机,安装了 4GB 内存(但仅由于 32 位事实,操作系统报告2.5GB)。我正在使用最新的Eclipse(编辑、构建和运行)和Ant(另一种构建和运行方式)积极修改旧的JAVA应用程序至少一个月。在 Eclipse 运行配置和 build.xml 文件中,我们有以下 JVM 参数:-Xmx1024M -Xms1024M -Xmn384M。我们多年来一直使用这种配置。

我还有一个批处理文件来使用以下参数启动 Eclipse:-vmargs -Xmx768M。这个批处理文件已经伴随我很多年了。 (现在我改为修改eclipse.ini来进行配置。)

前天,我发现使用Ant构建和运行我的应用程序时速度慢得多(我在修改过程中频繁构建和运行它)。我在回家之前重新启动了机器。那天晚上,我通过 VPN 连接到我的机器来完成一些修改(我是一名非常好的员工。),发现速度更慢。第二天早上,当我使用 Ant 运行应用程序时,开始出现“无法创建 Java 虚拟机”的情况。

我重新启动了我的机器。然后我无法启动 Eclipse,并出现同样的错误。我必须更改 vmargs 以声明仅需要 512MB 内存才能启动 Eclipse。使用 Ant 的构建时间从约 20 秒增加到约 6 分钟。我必须

-Xmx512M -Xms512M

在 Eclipse 运行配置和 Ant build.xml 中减少 JVM 的最大内存,以避免错误。

然后我卸载了 1.6u24 jdk/jre 并安装了 1.6u25。我重新安装了Eclipse。用趋势科技扫描了整个机器,没有发现什么。

我通常连接进行一些测试的另一台机器也有类似的结果(速度较慢)。所有其他机器,包括我同事的机器和我的笔记本电脑,都可以使用相同的应用程序和工具正常工作。

如果我使用 Ant 构建并运行它,构建过程和启动过程会非常慢。我创建了两个批处理文件来编译和启动我的应用程序。他们正常工作。用Eclipse编译时,可以正常运行。但我现在无法在所有情况下要求 JVM 为我的应用程序声明1024MB

我的机器上的所有其他活动看起来都很正常。 VisualStudio 和 C# 应用程序照常工作。由于硬盘故障,我的机器几周前被重建。所以没有太多无用的东西会拖慢我的机器速度。

任何人都可以帮我弄清楚为什么我的机器上的 JVM 改变了它的行为?我希望这不是病毒引起的。您知道在致电 IT 部门重建我的机器之前我可以尝试什么吗?

谢谢,

enter image description here

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.

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.)

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.

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

-Xmx512M -Xms512M

in both Eclipse run configuration and Ant build.xml in order to avoid error.

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.

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.

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.

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?

thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

醉酒的小男人 2024-11-15 13:36:34

虽然您的配置可能没有更改,但这并不意味着可用内存量没有更改。操作系统中的所有程序都会使用内存,因此如果另一个程序使用的内存稍大,则可能无法预先分配您指定的 1GB 内存(来自命令行参数)必须可用于启动JVM。

另一种可能性是安装/运行了一些新程序,并且它带着您需要的内存潜逃了。病毒扫描可能已安装/更新,并且它本身就可能非常消耗内存(取决于产品)。

最后,你提到机器被重建了。您可能需要验证(通过 BIOS)您实际上拥有与重建之前相同数量的物理内存。重建机器有一种有趣的方式,可以将记忆棒从插槽中取出(或者重建过程可能比表面上看到的要多)。问题可能很简单,因为没有足够的内存可以预先分配给 JVM,因为您一开始的内存较少。

如果所有这些都检查完毕,请检查那些晦涩难懂的东西。如果您重新安装了非常旧的或不同的操作系统,它可能不支持访问所安装的那么多内存。当有人从 64 位安装恢复到 32 位安装时,通常会发生这种情况。

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.

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.

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.

若相惜即相离 2024-11-15 13:36:34

使用 Microsoft 的任务管理器或进程资源管理器 (http://technet.microsoft.com/en-us/sysinternals/bb896653) 并检查内存占用情况。如果您必须减少正在使用的内存量,很可能是因为其他东西占用了它。另外,我发现 2.5GB 的上限有点奇怪,因为我认为上限更像是 3.25GB(主要是因为这是我在安装了 4GB 的 Windows XP 上的容量)。

另外,每次我看到该错误消息时,都是因为没有足够的物理内存可供获取。过去,我必须关闭程序才能在收到此异常后运行一些操作。

(我会把它放在评论中,但还没有评级:/)

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).

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 :/ )

离旧人 2024-11-15 13:36:34

你能在任务管理器中看到什么奇怪的东西吗? CPU利用率?事实上,你不能像以前那样分配那么多内存,这听起来很奇怪,但在我的一台开发机器上升级防病毒软件后,我发现编译时间也有类似的减少。

如果在编译时禁用防病毒软件会发生什么?

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.

What happens if you disable antivirus while you do a compilation?

孤城病女 2024-11-15 13:36:34

这听起来更像是配置问题而不是病毒,特别是考虑到它是最近重建的。 您没有提及您使用的是 32 位还是 64 位 Java。了解失败时正在尝试运行的程序可能会有所帮助。

其他要检查的事项:虚拟内存设置;操作系统中任何特定于应用程序的设置;防病毒程序设置;其他进程(尝试运行 HijackThis 和/或 MSRT)。

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.

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文