JBoss 中外部进程的内存分配
我们使用 JBoss EJB 通过 im4Java 启动的 ImageMagick 来生成图像文件。 im4Java 是 imagemagick 的 Java 接口,使用 java.lang.ProcessBuilder 启动外部进程。几次成功运行后,我们被以下内容阻止: java.io.IOException: Cannot run program "/usr/local/bin/convert": java.io.IOException: error=12, Cannot allocate memory
这似乎不是 ImageMagick 问题,因为如果我们从命令行,完美运行。但更多的是为外部进程分配 Jboss 内存。
有什么想法吗?
We are using ImageMagick launched by a JBoss EJB by the way of im4Java, to produce image files. im4Java is an Java interface to imagemagick, launching external process with java.lang.ProcessBuilder. After few successfull runs, we are blocked by a :
java.io.IOException: Cannot run program "/usr/local/bin/convert": java.io.IOException: error=12, Cannot allocate memory
It seems not to be an ImageMagick issue, because if we launch the same process from command line, it runs perfectly. But more a Jboss memory allocation for an external process.
Any idea ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
终于解决了,但也许不是最好的方法。确实,我们已经使用了Ivan指出的Linux中overcommit_memory变量的解决方案,没有再出现问题。但我们不确定更改此内存全局设置不会影响系统以后的整个行为,因为它似乎分配了更多内存。希望我们不要经常从 java 代码中运行 imagemagick,这样一旦 imagemagick 完成工作,内存就会被释放。
Finally solved, but maybe not the best way. Indeed , we have used the solution of the overcommit_memory variable in Linux indicated by Ivan, and no problem any more. But we are not sure changing that this memory global settings would not affect the whole behavior of the system later, as it seems to allocate a lot more memory. Hopefully we do not run so often imagemagick from java code, so memory is released once imagemagick did his job.