Today, when metamap is used to process PubMed data, java. Lang. outofmemoryerror: Java heap space is always encountered. I searched the internet and finally found a solution. record it.
The following content is from: wfnlibo
Because the program needs to read nearly rows of data for processing, when it reads, an error such as Java. Lang. outofmemoryerror: Java heap space occurs.
Check on the Internet may be the reason why Java's stack settings are too small.
There are two solutions to this problem:
1. Set Environment Variables
Set java_opts =-xms32m-xmx512m
It can be changed based on the memory of your machine, but I did not solve the problem by testing this method. It may be where to set it.
2. Java-xms32m-xmx800m classname
This parameter is added when the Java class file is executed. classname indicates the class name to be executed. (Including package name)
This solves the problem. In addition, the execution speed is much faster than when no setting is made.
If you may use eclispe during the test, you need to enter the-xms32m-xmx800m parameter in the VM arguments in eclipse-> Run-arguments.
The second method is very reliable and highly recommended. Thank you.Wfnlibo.