数学与数学 J/Link:内存限制?
我正在使用 Mathematica 及其 J/Link Java 接口进行计算密集型基准测试。
如果内存占用达到约 320 MB,基准测试就会停止,因为这似乎是极限,垃圾收集器需要越来越多的时间,最终会失败。
Mathematica 函数 ReinstallJava 采用参数命令行。 我尝试这样做
ReinstallJava[CommandLine -> "java -Xmx2000m ..."]
,但 Mathematica 似乎完全忽略了 -Xmx 选项。
如何为我的 java 程序设置 -Xmx 内存选项? 320MB的限制从何而来? 任何帮助将不胜感激。
I am doing a computing-intensive benchmark using Mathematica and its J/Link Java interface.
The benchmark grinds to a halt if a memory footprint of about 320 MB is reached, since this seems to be the limit and the garbage collector needs more and more time and will eventually fail.
The Mathematica function ReinstallJava takes the argument command line. I tried to do
ReinstallJava[CommandLine -> "java -Xmx2000m ..."]
but Mathematica seems to ignore the -Xmx option completely.
How can I set the -Xmx memory option for my java program? Where does the limit of 320 MB come from? Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ReinstallJava
采用JVMArguments
选项。 您可以使用它来传递堆大小,如下所示:(我曾经在绝望中通过阅读 C:\Program Files\Wolfram Research\Mathematica\7.0\SystemFiles\Links\JLink\KernelOptions[ReinstallJava] 中后,这似乎很明显......)
ReinstallJava
takes aJVMArguments
option. You can use it to pass heap size like so:(I once figured this out in desperation by reading through the code in
C:\Program Files\Wolfram Research\Mathematica\7.0\SystemFiles\Links\JLink\Kernel
. After noticing it was listed inOptions[ReinstallJava]
it seemed kind of obvious…)对于 Mac OS X 用户,替换
为
For Mac OS X users, replace
by