我使用java编写的一个应用程序,用于产生数据插入到HBase数据库中,但是程序在运行一段时间后就会产生OOM异常:Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native threadat java.lang.Thread.start0(Native Method)at java.lang.Thread.start(Thread.java:640)at java.util.concurrent.ThreadPoolExecutor.addIfUnderCorePoolSize(ThreadPoolExecutor.java:703)at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:652)at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:92)at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatch(HConnectionManager.java:1401)at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.processBatchOfPuts(HConnectionManager.java:1499)at org.apache.hadoop.hbase.client.HTable.flushCommits(HTable.java:859)at org.apache.hadoop.hbase.client.HTable.doPut(HTable.java:715)at org.apache.hadoop.hbase.client.HTable.put(HTable.java:693)at storm.monitor.hbase.BasicOperation.addRecord(BasicOperation.java:135)at storm.monitor.util.HBase_Operation.insertIntoHBase(HBase_Operation.java:75)at storm.monitor.util.Data_Generator.insertIntoHBase(Data_Generator.java:215)at storm.monitor.util.Data_Generator.run(Data_Generator.java:394)at storm.monitor.util.Data_Generator.init(Data_Generator.java:68)at storm.monitor.util.Data_Generator.(Data_Generator.java:41)at storm.monitor.util.Main_Generator.main(Main_Generator.java:22)可是我在类中获得Runtime,输出freeMemory,totalMemory如下free 505328288 total 528154624 max 1037959168,明显的可用内存还有很多,怎么会出现上述异常呢?在我的类中,方法多是静态方法,不过全局变量很少使用,一般都是创建的临时变量,并且是方法结束前都设为null。并且只有一个LinkedList全局对象和几个多维数组。在eclipse中设置了(x)arguments -Xms512m -Xmx1024m。到底是什么原因导致了OOM呢,整个应用程序中并没有创建线程的地方。求解惑!
添加回答
举报
0/150
提交
取消