我尝试使用(~800MB)h2o steam
文件在pojo
的预测服务构建器中构建.war文件(大小约为200MB的similara pojo也产生了同样的问题)。但是,在尝试此操作时,点击' build':
Problem accessing /makewar. Reason:
Compilation of pojo failed exit value 3 warning: [options] bootstrap class path not set in conjunction with -source 1.6
The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:255)
at com.sun.tools.javac.util.BaseFileManager.makeByteBuffer(BaseFileManager.java:302)
at com.sun.tools.javac.file.RegularFileObject.getCharContent(RegularFileObject.java:114)
at com.sun.tools.javac.file.RegularFileObject.getCharContent(RegularFileObject.java:53)
at com.sun.tools.javac.main.JavaCompiler.readSource(JavaCompiler.java:602)
at com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:665)
at com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:950)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
at com.sun.tools.javac.main.Main.compile(Main.java:523)
at com.sun.tools.javac.main.Main.compile(Main.java:381)
at com.sun.tools.javac.main.Main.compile(Main.java:370)
at com.sun.tools.javac.main.Main.compile(Main.java:361)
at com.sun.tools.javac.Main.compile(Main.java:56)
at com.sun.tools.javac.Main.main(Main.java:42)
我按照this文档中的说明从命令行启动Prediction Service Builder。有没有办法用更多内存启动服务构建器?
更新
使用命令:
$ GRADLE_OPTS=-Xmx4g ./gradlew jettyRunWar
尝试从pojo构建.war会返回cli错误:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/reedv/.gradle/wrapper/dists/gradle-2.7-all/2glqtbnmvcq45bfjvhghri39p6/gradle-2.7/lib/gradle-core-2.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/reedv/Documents/h2o_production/h2o-steam/steam/prediction-service-builder/build/tmp/jettyRunWar/webapp/WEB-INF/lib/slf4j-simple-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
2017-09-21 15:22:48.084 -1000 [1222676357@qtp-1014435252-3] INFO MakeWarServlet - servletPath = /home/reedv/Documents/h2o_production/h2o-steam/steam/prediction-service-builder/build/tmp/jettyRunWar/webapp
2017-09-21 15:22:48.086 -1000 [1222676357@qtp-1014435252-3] INFO MakeWarServlet - tmpDir /tmp/makeWar316567921053262563022859149567148
2017-09-21 15:22:57.175 -1000 [1222676357@qtp-1014435252-3] INFO MakeWarServlet - added pojo model drf_denials_v4_v3-10-5-2.java
2017-09-21 15:22:57.190 -1000 [1222676357@qtp-1014435252-3] INFO MakeWarServlet - prejar null preclass null
2017-09-21 15:22:58.047 -1000 [1222676357@qtp-1014435252-3] INFO Util - warning: [options] bootstrap class path not set in conjunction with -source 1.6
2017-09-21 15:23:25.017 -1000 [1190941229@qtp-1014435252-0] INFO MakeWarServlet - tmpDir /tmp/makeWar432278342000106527922896081353600
2017-09-21 15:23:39.448 -1000 [1190941229@qtp-1014435252-0] INFO MakeWarServlet - added pojo model drf_denials_v4_v3-10-5-2.java
2017-09-21 15:23:39.569 -1000 [1190941229@qtp-1014435252-0] INFO MakeWarServlet - prejar null preclass null
2017-09-21 15:23:40.651 -1000 [1190941229@qtp-1014435252-0] INFO Util - warning: [options] bootstrap class path not set in conjunction with -source 1.6
2017-09-21 15:23:57.124 -1000 [1190941229@qtp-1014435252-0] INFO Util - OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006efd00000, 1592786944, 0) failed; error='Cannot allocate memory' (errno=12)
2017-09-21 15:23:57.604 -1000 [1190941229@qtp-1014435252-0] INFO Util - #
2017-09-21 15:23:57.605 -1000 [1190941229@qtp-1014435252-0] INFO Util - # There is insufficient memory for the Java Runtime Environment to continue.
2017-09-21 15:23:57.616 -1000 [1190941229@qtp-1014435252-0] INFO Util - # Native memory allocation (mmap) failed to map 1592786944 bytes for committing reserved memory.
2017-09-21 15:23:57.619 -1000 [1190941229@qtp-1014435252-0] INFO Util - # An error report file with more information is saved as:
2017-09-21 15:23:57.622 -1000 [1190941229@qtp-1014435252-0] INFO Util - # /tmp/makeWar432278342000106527922896081353600/hs_err_pid32313.log
2017-09-21 15:23:57.747 -1000 [1190941229@qtp-1014435252-0] ERROR MakeWarServlet - doPost failed
java.lang.Exception: Compilation of pojo failed exit value 1 warning: [options] bootstrap class path not set in conjunction with -source 1.6
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006efd00000, 1592786944, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 1592786944 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /tmp/makeWar432278342000106527922896081353600/hs_err_pid32313.log
at ai.h2o.servicebuilder.Util.runCmd(Util.java:162)
at ai.h2o.servicebuilder.MakeWarServlet.doPost(MakeWarServlet.java:151)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:440)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
2017-09-21 15:23:58.039 -1000 [1190941229@qtp-1014435252-0] ERROR MakeWarServlet - Compilation of pojo failed exit value 1 warning: [options] bootstrap class path not set in conjunction with -source 1.6
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006efd00000, 1592786944, 0) failed; error='Cannot allocate memory' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 1592786944 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /tmp/makeWar432278342000106527922896081353600/hs_err_pid32313.log
将内存分配值增加到Xmx6g或Xmx7g仍然会产生同样的错误。
此外,查找本应由此错误创建的文件/tmp/makeWar432278342000106527922896081353600/hs_err_pid32313.log
,似乎没有名为" makeWar432278342000106527922896081353600"的目录。在我的root tmp /目录中,所以我不确定在哪里查找它。
答案 0 :(得分:0)
我猜你是用Gradle开始的。在这种情况下,您可以使用GRADLE_OPTS=-Xmx4g ./gradlew jettyrunwar
以4 GB的内存启动它。