Sg2.9
running out of heap space
Recent RSS
running out of heap space
From:  Axel
Date:  5. October 2010, 14:02

Hi,

when i create a lot of items with my Scriptographer script, at some point i get an error that tells me that java ran out of heap space.

com.scriptographer.ai.Tool.onHandleEvent(Tool.java:309)
OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
OutOfMemoryError: Java heap space

how can i deal with it? By now i see two options:

First: Increase heap space
Is there any way to simply increase the heap space? (i know this doesnt solve the problem it's just delaying it)

Second: better programming
how can i remove items from the heap to create more space? By now i delete items i don't need anymore by removing the path and removing the Object that holds this path (i need those Objects)
Is there anything i can do additionally?

How about javas garbage collection? Is there a way to trigger it manually? More important: would that make any sense?

best regards,
Axel

Re: running out of heap space
From:  Jürg Lehni
Date:  14. October 2010, 12:09

You can increase Java's memory by setting the initial an maximal heap size in the jvm.ini file.
This file is not present by default, but you can simply create it in the directory Scriptographer/Core/java, edit it with any text editor and define the memory settings:

  • Xms defines the initial size
  • Xmx defines the maximum size

Example:

  • Xms40m
  • Xmx512m

This sets 40mb as the initial size, and 512mb as the maximum size.

But be careful, as too high values can crash Scriptographer and Illustrator on startup, depending on your system. Play with the values until you get something decent.

I Hope that helps.

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Voronoi Tool 21.01.11