内存不足异常,试图将文件中的大量数据行写入corda

时间:2018-07-25 10:42:55

标签: java corda

我需要将发送的数据注册表文件写入Corda。我在“流程”中调用“调用”方法。第一行写得正常。

当我尝试在Corda中写入大量数据行时发生错误:

    Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "FiberTimedScheduler-default-fiber-pool"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "FiberTimedScheduler-Same thread scheduler"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "rpc-server-reaper-0"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "RxIoScheduler-1 (Evictor)"
Exception in thread "Timer-0" java.lang.OutOfMemoryError: Java heap space
Exception in thread "server-timer" java.lang.OutOfMemoryError: Java heap space
Exception in thread "threadDeathWatcher-3-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "Thread-1 (activemq-netty-threads)" java.lang.OutOfMemoryError: Java heap space
Exception in thread "RxIoScheduler-2" java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
       at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:59)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
       at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.OutOfMemoryError: Java heap space
Exception in thread "Thread-6" java.lang.OutOfMemoryError: Java heap space

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "MVStore background writer nio:C:/Users/Evsin/Desktop/CordaProjectV2/build/nodes/PartyA/persistence.mv.db"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-0 (ActiveMQ-scheduled-threads)"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-1 (ActiveMQ-scheduled-threads)"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-4 (ActiveMQ-scheduled-threads)"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "activemq-failure-check-thread"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-1 (ActiveMQ-client-netty-threads)"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-2 (activemq-netty-threads)"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-3 (activemq-netty-threads)"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-0 (activemq-netty-threads)"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "Thread-1 (activemq-netty-threads)"
Exception in thread "Thread-3 (ActiveMQ-client-netty-threads)" java.lang.OutOfMemoryError: Java heap space
Exception in thread "Thread-2 (activemq-netty-threads)" java.lang.OutOfMemoryError: Java heap space

Image with code here

1 个答案:

答案 0 :(得分:0)

此问题很可能是由于堆大小不足引起的。默认情况下,Corda节点的Java堆大小为512MB。

在启动节点时,可以通过使用-Xmx命令行参数来增加该节点可用的Java堆内存量。例如,以下将运行堆大小为2048MB的节点:

java -Xmx2048m -jar corda.jar