用于查看/解决Windows XP内存碎片的工具 [英] Tools to view/solve Windows XP memory fragmentation

查看:599
本文介绍了用于查看/解决Windows XP内存碎片的工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个需要大量堆空间的java程序 - 我们从(在其他命令行参数中)启动参数-Xmx1500m,它指定最大堆空间为1500 MB。在刚刚重新启动的Windows XP机器上启动此程序时,它将启动并运行没有问题。但是如果程序运行了几次,计算机已经运行了一段时间等等,当它试图启动时我会收到这个错误:

We have a java program that requires a large amount of heap space - we start it with (among other command line arguments) the argument -Xmx1500m, which specifies a maximum heap space of 1500 MB. When starting this program on a Windows XP box that has been freshly rebooted, it will start and run without issues. But if the program has run several times, the computer has been up for a while, etc., when it tries to start I get this error:


Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

我怀疑Windows本身正在遭受内存碎片,但我不知道如何证实这种怀疑。在发生这种情况时,任务管理器和sysinternals procexp报告2000MB可用内存。我查看了这个与内部碎片有关的问题

I suspect that Windows itself is suffering from memory fragmentation, but I don't know how to confirm this suspicion. At the time that this happens, Task manager and sysinternals procexp report 2000MB free memory. I have looked at this question related to internal fragmentation

所以第一个问题是,我如何确认我的怀疑?
第二个问题是,如果我的怀疑是正确的,有没有人知道解决这个问题的任何工具?我看了很多,但除了定期重新启动机器外,我还没有发现任何有用的东西。

So the first question is, How do I confirm my suspicion? The second question is, if my suspicions are correct, does anyone know of any tools to solve this problem? I've looked around quite a bit, but I haven't found anything that helps, other than periodic reboots of the machine.

ps - 改变操作系统目前也不是一个可行的选择。

ps - changing operating systems is also not currently a viable option.

推荐答案

同意Torlack,其中很多是因为其他DLL正在加载并进入某些位置,分解了数量你可以在一个大块中获得VM的内存。

Agree with Torlack, a lot of this is because other DLLs are getting loaded and go into certain spots, breaking up the amount of memory you can get for the VM in one big chunk.

你可以在WinXP上做一些工作,如果你有超过3G的内存来获得一些windows的东西移动,在这里查找PAE:
http: //www.microsoft.com/whdc/system/platform/server/PAE/PAEdrv.mspx

You can do some work on WinXP if you have more than 3G of memory to get some of the windows stuff moved around, look up PAE here: http://www.microsoft.com/whdc/system/platform/server/PAE/PAEdrv.mspx

你最好的选择,如果你真的需要超过你的java应用程序的内存为1.2G,是看64位windows或linux或OSX。如果你在你的应用程序中使用任何类型的本机库,你将不得不重新编译它们64位,但它比试图改变dll和东西要容易得多,以最大限度地提高32位窗口的内存。

Your best bet, if you really need more than 1.2G of memory for your java app, is to look at 64 bit windows or linux or OSX. If you're using any kind of native libraries with your app you'll have to recompile them for 64 bit, but its going to be a lot easier than trying to rebase dlls and stuff to maximize the memory you can get on 32 bit windows.

另一种选择是将程序拆分为多个虚拟机,并让它们通过RMI或消息或其他方式相互通信。这样每个VM都可以拥有您需要的内存的一些子集。不知道你的应用程序做了什么,我不确定这会有什么帮助,不过......

Another option would be to split your program up into multiple VMs and have them communicate with eachother via RMI or messaging or something. That way each VM can have some subset of the memory you need. Without knowing what your app does, i'm not sure that this will help in any way, though...

这篇关于用于查看/解决Windows XP内存碎片的工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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