Java HBase的Bufferedmutator中的OutOfMemoryError
通过BufferedMutator在HBase中插入数据时出现以下错误Java HBase的Bufferedmutator中的OutOfMemoryError,java,hbase,threadpool,Java,Hbase,Threadpool,通过BufferedMutator在HBase中插入数据时出现以下错误 java.lang.OutOfMemoryError: unable to create new native thread at java.lang.Thread.start0(Native Method) at java.lang.Thread.start(Thread.java:717) at java.util.concurrent.ThreadPoolExecu
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:717)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:957)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1367)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
at org.apache.hadoop.hbase.client.AsyncRequestFutureImpl.sendMultiAction(AsyncRequestFutureImpl.java:547)
at org.apache.hadoop.hbase.client.AsyncProcess.submitMultiActions(AsyncProcess.java:337)
at org.apache.hadoop.hbase.client.AsyncProcess.submit(AsyncProcess.java:320)
at org.apache.hadoop.hbase.client.AsyncProcess.submit(AsyncProcess.java:228)
at org.apache.hadoop.hbase.client.BufferedMutatorImpl.doFlush(BufferedMutatorImpl.java:303)
at org.apache.hadoop.hbase.client.BufferedMutatorImpl.close(BufferedMutatorImpl.java:241)
在这里,我使用单个连接插入每个请求200-300字节长的数据。并生成同步查询。也可以在下面找到线程转储。其中,定时等待线程是htable池的一部分。
你能回答一下如何处理这个异常吗。
样本代码-
try(BufferedMutator mutator = Connection.creatConnection().getBufferedMutator(TableName.valueOf(tableName)) {
Put put = new Put(Bytes.toBytes(rowKey));
map.forEach(element->put.addColumn(CF,element.getKey(),element.getValue());
mutator.mutate(put);
} catch (Exception e) {
e.printStackTrace();
}
请提供代码的相关部分。添加一个包含正确输入/输出数据的示例。@b示例添加了有问题的示例代码,输入是包含100个条目的字符串映射。如何启动应用程序?HBase的配置是什么?特别是有多少内存?您在哪个操作系统上工作?简单Java脚本通过Java命令从一台服务器启动到HBase服务器。HBase有1个主服务器和6个区域服务器。在脚本运行时,服务器有25-30GB的可用内存,并从ubuntu操作系统运行。