Java Derby内存不足

Java Derby内存不足,java,sql,Java,Sql,我试图在net beans数据库中加载100000条记录,结果出现以下错误: java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC: java.lang.OutOfMemoryErrorPermGen spaceXJ001.U at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Sour

我试图在net beans数据库中加载100000条记录,结果出现以下错误:

java.sql.SQLException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC: java.lang.OutOfMemoryErrorPermGen spaceXJ001.U
    at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
    at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
    at org.apache.derby.client.am.Connection.prepareStatement(Unknown Source)
    at etl1.DBhandler.insertShuj1(DBhandler.java:150)
    at etl1.ETL1.shuja(ETL1.java:70)
    at etl1.ETL1.main(ETL1.java:32)
Caused by: org.apache.derby.client.am.SqlException: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC: java.lang.OutOfMemoryErrorPermGen spaceXJ001.U
    at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
    at org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source)
    at org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source)
    at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown Source)
    at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown Source)
    at org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown Source)
    at org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown Source)
    at org.apache.derby.client.am.PreparedStatement.readPrepareDescribeInputOutput(Unknown Source)
    at org.apache.derby.client.am.PreparedStatement.flowPrepareDescribeInputOutput(Unknown Source)
    at org.apache.derby.client.am.PreparedStatement.prepare(Unknown Source)
    at org.apache.derby.client.am.Connection.prepareStatementX(Unknown Source)
    ... 4 more
java.sql.SQLNonTransientConnectionException: A network protocol error was encountered and the connection has been terminated: the requested command encountered an unarchitected and implementation-specific condition for which there was no architected message (additional information may be available in the derby.log file on the server)
    at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
    at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
    at org.apache.derby.client.am.Connection.prepareStatement(Unknown Source)
    at etl1.DBhandler.insertShuj1(DBhandler.java:150)
    at etl1.ETL1.shuja(ETL1.java:70)
    at etl1.ETL1.main(ETL1.java:32)
Caused by: org.apache.derby.client.am.SqlException: A network protocol error was encountered and the connection has been terminated: the requested command encountered an unarchitected and implementation-specific condition for which there was no architected message (additional information may be available in the derby.log file on the server)
    at org.apache.derby.client.am.SqlException.copyAsUnchainedSQLException(Unknown Source)
    at org.apache.derby.client.am.Sqlca.chainDeferredExceptionsToAgentOrAsConnectionWarnings(Unknown Source)
    at org.apache.derby.client.am.Sqlca.getJDBCMessage(Unknown Source)
    at org.apache.derby.client.am.SqlException.getMessage(Unknown Source)
    ... 5 more
java.sql.SQLNonTransientConnectionException: No current connection.
    at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
    at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
    at org.apache.derby.client.am.Connection.prepareStatement(Unknown Source)
    at etl1.DBhandler.insertShuj1(DBhandler.java:150)
    at etl1.ETL1.shuja(ETL1.java:70)
    at etl1.ETL1.main(ETL1.java:32)

我确实知道记忆是不够的,但如何增加它呢?这里确实需要帮助

您在所谓的“永久”堆中的空间不足。请尝试
-XX:MaxPermSize=128m
-XX:MaxPermSize=256m
。您可能还需要增加常规堆,例如,
-Xmx1024m