我在从Netbeans编译java文件时遇到java堆空间错误。
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.mysql.jdbc.Buffer.<init>(Buffer.java:59)
at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1975)
at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3437)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:488)
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3131)
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2299)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2722)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2788)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2738)
at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1617)
我可以将opencv的VM选项设置为本机库,如下所示:
-Djava.library.path="C:\opencv\build\java\x86"
如何在VM选项中为java max heap size -Xmx2048m
设置第二个选项?
还是有另一种方法来增加netbeans中的Java堆大小?