我有一个在JBoss AS 7下运行的Java应用程序,它使用Runtime.getRuntime().exec(command)
来调用相当复杂的bash脚本。 bash脚本失败,因为cvs报告内存不足(错误是“E342:内存不足!”)。
那么我应该增加JBoss AS的可用内存量(用JAVA_OPTS =“ – Xms256m -Xmx2048m”或类似的东西),还是这表明操作系统本身的内存不足?
操作系统内存不足。 增加JBoss的堆大小只会让事情变得更糟。
你应该看看像这样的东西:
事实证明,这是VIM。 我正在运行脚本,在空的命令下调用了cvs,这可能导致了这个问题。 最后,我刚刚创建了一个脚本来编辑带有通用消息的消息文件:
#!/bin/sh # Add a generic message echo "Some Generic Message" > $1 # Update the time stamp. If you don't, you'll get a # "Log message unchanged or not specified" error. # the cvs timestamp comparison routine has a resolution # of one second, so sleep to ensure that the timestamps # are detected as being different. sleep 1 touch $1 exit 0
然后将EDITOR或CVSEDITOR环境变量设置为指向脚本。