OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

Announcement

A fix has been applied to the login system for the forums - if you have trouble logging in please contact support@openstreetmap.org with both your forum username and your OpenStreetMap username so we can make sure your accounts are properly linked.

#1 2017-11-11 19:43:47

silver mapper
Member
Registered: 2008-06-26
Posts: 56

JOSM and lack of memory

I have been struggling with JOSM recently.  Editing responses are so slow at times.  Bing imagery appears to be a factor: it struggles to refresh.  The worst moment came today when an error message appeared, informing me JOSM is out of memory.  I was unable to close that window and right-clicking the JOSM icon at the foot of the screen to "Close window" did not work.  I had to shut down the desktop and restart.  Nothing like this has happened before in my nine years of working with JOSM.  Its version is 13053, the latest.

Last edited by silver mapper (2017-11-11 19:47:16)

Offline

#2 2017-11-11 21:23:11

RicoElectrico
Member
Registered: 2012-07-01
Posts: 786

Re: JOSM and lack of memory

Incidentally, I've also seen a similar issue. Windows is notifying me there's not enough RAM. Never happened before.

Offline

#3 2017-11-11 22:24:23

SomeoneElse
Member
Registered: 2010-10-13
Posts: 687

Re: JOSM and lack of memory

It's just cropped up on the "talk" list too: https://lists.openstreetmap.org/piperma … 79535.html .

Offline

#4 2017-11-12 01:04:34

muralito
Member
Registered: 2012-09-04
Posts: 1,459

Re: JOSM and lack of memory

Yes, today i noticed problems in version 13053, almost unusable.

Offline

#5 2017-11-12 19:10:12

ff5722
Member
Registered: 2016-05-20
Posts: 105

Re: JOSM and lack of memory

silver mapper wrote:

I have been struggling with JOSM recently.  Editing responses are so slow at times.  Bing imagery appears to be a factor: it struggles to refresh.  The worst moment came today when an error message appeared, informing me JOSM is out of memory.  I was unable to close that window and right-clicking the JOSM icon at the foot of the screen to "Close window" did not work.  I had to shut down the desktop and restart.  Nothing like this has happened before in my nine years of working with JOSM.  Its version is 13053, the latest.

You can use the task manager and close the Java process instead of having to reboot your computer.

Not my own solution (it has come up in other threads) but add this line in your JNLP file to allow 1GB of memory for example:

<java version="1.8+" initial-heap-size="256m" max-heap-size="1024m"/>

JOSM.jnlp should look like this now

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0//EN" "http://java.sun.com/dtd/JNLP-6.0.dtd">
<jnlp spec="6.0+" codebase="https://josm.openstreetmap.de/download/" href="josm.jnlp">
    <information>
        <title>JOSM</title>
        <vendor>OpenStreetMap</vendor> 
        <homepage href="https://josm.openstreetmap.de"/> 
        <description>Java OpenStreetMap editor</description>
        <description kind="one-line">JOSM</description>
        <description kind="tooltip">JOSM</description>
        <icon href="https://josm.openstreetmap.de/svn/trunk/images/logo.png"/> 
        <offline-allowed/>
        <shortcut>
            <desktop/>
            <menu/>
        </shortcut>
    </information>
    <security>
        <all-permissions/>
    </security>
    <resources>
        <java version="1.8+" initial-heap-size="256m" max-heap-size="1024m"/>
        <jar href="josm-tested.jar"/>
        <property name="java.util.Arrays.useLegacyMergeSort" value="true"/>
    </resources>
    <application-desc main-class="JOSM"/>
</jnlp>

Offline

#6 2017-11-12 22:11:58

silver mapper
Member
Registered: 2008-06-26
Posts: 56

Re: JOSM and lack of memory

ff5722
I thank you for your constructive reply.
1. I am pleased that adverse situations happen rarely on my PC, so I do not think of Task Manager immediately.  I must make a note.
2. I am not experienced in DOS and commands, particularly.  .jlnp access appears to require the installation of Web Start from what I read and I imagine getting in over my head, which I resist, generally.  I do not understand its association with the .jar file. either.

Offline

#7 2017-11-13 00:04:10

Klumbumbus
Member
Registered: 2014-01-12
Posts: 460
Website

Re: JOSM and lack of memory

you can edit the jnlp file with the default text editor. To open it use javaws.exe in your java installation folder.

Offline

#8 2017-11-13 20:10:48

silver mapper
Member
Registered: 2008-06-26
Posts: 56

Re: JOSM and lack of memory

ff5722 and Klumbumbus
I have assimilated your two posts and another of Klumbumbus in https://forum.openstreetmap.org/viewtopic.php?id=52441:
The other way would be to download josm.jnlp, open this file in a text editor and replace the line
<j2se version="1.7+"/>
by
<j2se version="1.7+" initial-heap-size="256m" max-heap-size="768m"/>
Save and then always start josm by double clicking on the jnlp file. You can adjust the max-heap-size to your needs. The advantage of the jnlp is, that it auto downloads if a new stable version is availible.
Not understanding from where to download josm.jnlp, I carried out an internet search.  The first entry contained https://josm.openstreetmap.de/download/josm.jnlp, which downloaded the file.  I opened the file in Notepad and added initial-heap-size="256m" max-heap-size="1024m" as shown in this extract:
<resources>
        <java version="1.8+" initial-heap-size="256m" max-heap-size="1024m"
java-vm-args="--add-modules=java.activation,java.se.ee --add-
exports=java.base/sun.security.util=ALL-UNNAMED --add-
exports=java.base/sun.security.x509=ALL-UNNAMED --add-
exports=java.desktop/com.apple.eawt=ALL-UNNAMED --add-
exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED --add-
exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED --add-
exports=jdk.deploy/com.sun.deploy.config=ALL-UNNAMED --add-
opens=java.base/java.lang=ALL-UNNAMED --add-
opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-
opens=java.desktop/javax.imageio.spi=ALL-UNNAMED --add-
opens=java.desktop/javax.swing.text.html=ALL-UNNAMED --add-
opens=java.prefs/java.util.prefs=ALL-UNNAMED"/>
        <jar href="josm-tested.jar"/>
I double-clicked josm.jnlp, which opened JOSM version 13053 (not the latest now, it seems, because I was informed I should update).  That aside, my feeling was that the speed of refresh was much faster with my usual content: a .gpx file, downloaded data and Bing imagery.
I write this lengthy post, i. in order for both of you to confirm my actions were correct and ii. to help, perhaps, others of the same limited knowledge as me.

Last edited by silver mapper (2017-11-13 20:12:32)

Offline

#9 2017-11-13 22:06:37

Klumbumbus
Member
Registered: 2014-01-12
Posts: 460
Website

Re: JOSM and lack of memory

There are two different versions of josm with different jnlp files:

- josm.jnlp uses always the current stable version, which is updated once a month. This is suitable for the default user. (current version 13053)

- josm-latest.jnlp uses always the newest development version, which is updated every day. This is suitable for more advanced users as this version can contain small or big bugs. (current version 13119)

You can download both jnlp files here: https://josm.openstreetmap.de/

Offline

#10 2017-11-13 22:14:04

Klumbumbus
Member
Registered: 2014-01-12
Posts: 460
Website

Re: JOSM and lack of memory

...it seems you already did fine. You can check if it worked by clicking in JOSM on menu Help -> Show status report (https://josm.openstreetmap.de/wiki/Help … atusReport) and look for the line e.g. "Memory Usage: 2057 MB / 3641 MB". The first number (2057 in this case) is the current memory and the second (3641 in this case) is the maximum possible josm memory (which you defined with max-heap-size).

Last edited by Klumbumbus (2017-11-13 22:14:48)

Offline

#11 2017-11-14 11:21:24

SafwatHalaby
Member
Registered: 2017-04-10
Posts: 392
Website

Re: JOSM and lack of memory

For the record, the problem I posted at the talk list was about hangs, and not memory consumption, and I am not sure whether the issues are or aren't related.

Talk list: https://lists.openstreetmap.org/piperma … 79535.html
Issue tracker ticket: https://josm.openstreetmap.de/ticket/15547

Last edited by SafwatHalaby (2017-11-14 11:21:42)

Offline

#12 2017-11-14 12:22:37

silver mapper
Member
Registered: 2008-06-26
Posts: 56

Re: JOSM and lack of memory

Klumbumbus
I thank you for your additional information; I never knew of the Status Report in JOSM>Help>Show Status Report.  I learn so much, still, through my use of various forums.  What a marvellous source of information they prove to be.  I am ever grateful.

Offline

Board footer

Powered by FluxBB