Menu

#2689 Heap space exception when installing an addon

Current Release
new
nobody
None
normal
minor
Always
none
Windows 7
2019-08-18
2019-07-15
lilive
No

Hello,

Freeplane fail to install an addon and display this message:

L'installation a échoué (The installation failed). Erreur : org.freeplane.plugin.script.ExecuteScriptException: Java heap space.

Here's the relevant section in log.0

STDOUT: juil. 15, 2019 7:26:14 PM org.freeplane.core.util.LogUtils info
INFOS: installing add-on from file:/C:/Users/xxxx/Documents/freeplane/bookmarks/bookmarks.addon.mm
STDOUT: juil. 15, 2019 7:26:27 PM org.freeplane.core.util.LogUtils warn
AVERTISSEMENT: L'installation a échoué. Erreur : org.freeplane.plugin.script.ExecuteScriptException: Java heap space.

Sometimes Freeplane hang for a long time (many minutes) trying to install the addon, sometimes not. During this time java eat >90% of my CPU and 700MB RAM (against 400MB when Freeplane is opened with a empty map). Fast or slow, the result is always the same with the heap space exception.

This is an addon I'm currently developing. Everything was fine until today, when I tried to add some documentation in the addon. This documentation is a mix of html, css and images (svg and gif) files in the zips/doc folder. The content of this folder is not so big: <13MB for 37 files.

I add the addon packaged for publication to this ticket, and also the addon sources.

Freeplane 1.7.9
Java 1.8
Windows 7
8 GB RAM

1 Attachments

Discussion

  • Felix Natter

    Felix Natter - 2019-07-27

    hi ilive,

    please use freeplane.bat and increase freeplane's heap size as described here:
    https://www.freeplane.org/forum2012/viewtopic.php?f=1&t=818

    Cheers and Best Regards,
    Felix

     
  • lilive

    lilive - 2019-07-27

    Thank you Felix.
    I can install the addon by increasing the heap size.
    But this seems to be kind of a not easy fix to ask to regular users who wish to install my addon.
    I'm sorry about that. I wrote a really good documentation for this addon but it doesn't look like a good idea to distribute it with this installation problem.

    Here's the Private Bytes reported by Process Explorer for different values of java -Xmx, when Freeplane starts and when I install the addon:

    java -Xmx After FP launch During installation
    800M 550M 900M
    1G 550M 1200M
    2G 600M 1600M
    4G 670M 2100M

    Freeplane manage to install the addon as soon as -Xmx is 800M.

    Does this feel right ? I'm wondering. I've just got 13M files for the documentation (mostly animated gifs), this isn't so big. Why does Freeplane need so much memory to deal with them ? Is it a Freeplane thing, or is it a java zip library problem ?

    Cheers,
    lilive

     
  • Volker Börchers

    lilive, there are perhaps numerous copies that have to be kept in memory while unpacking and installing the add-on. I suggest that you exclude the detailled descriptions / animated GIFs from your add-on and direct the users to your Github page or to a YouTube video for that instead.

    If I find the time I'll investigate if the installer's memory usage can be reduced.

     
  • Volker Börchers

    And please add an installation file that I can use for testing purposes.