java heap space error
- To: mathgroup at smc.vnet.net
- Subject: [mg103200] java heap space error
- From: fd <fdimer at gmail.com>
- Date: Thu, 10 Sep 2009 07:21:57 -0400 (EDT)
Using Databaselink or JLink in Mathematica the amount of memory allocated to the Java virtual machine is limited. This may cause error when e.g. fetching large amounts of data using a JDBC driver with Datalink. To solve this issue I found that you have to re-set java configurations on Mathematica by executing the following commands before any command using JLink/Databaselink is used: Needs["JLink`"] ReinstallJava[CommandLine -> "javaw.exe -XX:NewSize=800m"]; The last command re-set the java heap size to 800 MB. As stated above, the path to java is in the system's path, otherwise you'll have to include the full path in the CommandLine option, like this: ReinstallJava[CommandLine->"C:\\Program Files\\Java\\Bin\\javaw.exe - XX:NewSize=800m"]; Hope this helps someone someday best