How to reduce memory footprint for sequence diagram?

0 votes
asked Sep 22, 2014 in Wanted features by anonymous
I am enhancing the custom ABAP extension to generate PlantUML code for sequence diagrams from a call stack created from an ABAP trace. The problem is, I can easily generate quite large files. But I feel PlantUML will often abort too soon and can only be used for a modest amount of actors/participant (say less than 15, in some case, I have problem with an input file size of 14kB).

I am looking at ways to increase the size of outputs that can be generated. I found that

- I can increase the memory, but it seems if the limit is exceeded, PlantUML is just freezing the machine,

- I could reduce the memory footprint by generating SVG files instead of PNG, but I then those SVG files are freezing the normal viewer (e.g. Chrome)

are there any other tips you could recommend?




3 Answers

0 votes
answered Sep 22, 2014 by plantuml (293,520 points)
The best thing that you can do is to send us your 14kB input file so that we can perform some optimizations.

(Note that you can also use the "newpage" keyword to split you diagram into several PNG files)

commented Feb 17, 2015 by anonymous
I have a similar problem with a class structure about 5000 lines(I was trying to visualize EntityFramework 6 Code First approach with 8 tables).
I could use java -Xmx1500m -jar plantuml.jar, but it is not enough and i still got OutOfmemoryError: Java heap space.
With best regards,

 java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space
        at Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at net.sourceforge.plantuml.swing.MainWindow2.refreshDir(Unknown Source)
        at net.sourceforge.plantuml.swing.MainWindow2.access$600(Unknown Source)
        at net.sourceforge.plantuml.swing.MainWindow2$ Source)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$400(Unknown Source)
        at java.awt.EventQueue$ Source)
        at java.awt.EventQueue$ Source)
        at Method)
        at$1.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at Source)
Caused by: java.lang.OutOfMemoryError: Java heap space
        at java.awt.image.DataBufferInt.<init>(Unknown Source)
        at java.awt.image.Raster.createPackedRaster(Unknown Source)
        at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
        at java.awt.image.BufferedImage.<init>(Unknown Source)
        at net.sourceforge.plantuml.EmptyImageBuilder.<init>(Unknown Source)
        at net.sourceforge.plantuml.ugraphic.ImageBuilder.createUGraphicPNG(Unknown Source)
        at net.sourceforge.plantuml.ugraphic.ImageBuilder.createUGraphic(Unknown Source)
        at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageTOBEMOVED(Unknown Source)
        at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageTOBEMOVED(Unknown Source)
        at net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFileInternal(Unknown Source)
        at net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFile(Unknown Source)
        at net.sourceforge.plantuml.cucadiagram.CucaDiagram.exportDiagramInternal(Unknown Source)
        at net.sourceforge.plantuml.classdiagram.ClassDiagram.exportDiagramInternal(Unknown Source)
        at net.sourceforge.plantuml.UmlDiagram.exportDiagram(Unknown Source)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagramsCuca(Unknown Source)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(Unknown Source)
        at net.sourceforge.plantuml.SourceFileReader.getGeneratedImages(Unknown Source)
        at net.sourceforge.plantuml.DirWatcher2$ Source)
        at net.sourceforge.plantuml.DirWatcher2$ Source)
        at Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$ Source)
        at Source)
commented Feb 17, 2015 by plantuml (293,520 points)
Could you send us your diagram ? It's difficult to know what's going on without any data.
0 votes
answered Feb 17, 2015 by anonymous
I ended with generating svg and then convert it to png with inkskape
0 votes
answered Feb 17, 2015 by plantuml (293,520 points)
A way of turing arround this is to specify a size for the generated image.

For example, you can add in the diagram definition:

scale 1000 width

(see )