Modify

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#15894 closed task (fixed)

How increase allocated memory when using JOSM webstart?

Reported by: iman Owned by: team
Priority: normal Milestone:
Component: Core Webstart Version: latest
Keywords: java webstart Xmx memory josm.jnlp command line options Cc:

Description

Hi, I'm on Windows 7 with the latest Java installed. I've installed JOSM using "josm.jnlp" Webstart.

When I add -Xmx1024M to the target path of JOSM shortcut, like this:

"C:\Program Files\Java\jre1.8.0_161\bin\javaws.exe" -Xmx1024M -localfile -J-Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp "C:\Users\UserName\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\56\1ee8cfb8-6314d71c"

the allocated memory doesn't change. How may I do this?

There is no problem with "josm-tested.jar" and adding -Xmx1024M will work.

Attachments (0)

Change History (12)

comment:1 by Hb---, 6 years ago

Are the JAVA run options case sensitive? Did you check https://josm.openstreetmap.de/wiki/Help/CommandLineOptions ?

comment:2 by Don-vip, 6 years ago

Component: AppletCore Webstart

Applet has been dropped years ago. Please don't use this component.

in reply to:  1 comment:3 by anonymous, 6 years ago

Replying to Hb---:

Are the JAVA run options case sensitive? Did you check https://josm.openstreetmap.de/wiki/Help/CommandLineOptions ?

Not sure, maybe not. I tried -Xmx1024m, but no luck.

As mentioned at JNLP File Syntax I modified the josm.jnpl file in one of these ways and memory allocation worked:

  • Adding -Xmx1024m argument to java-vm-args.
  • Adding max-heap-size=1024M attribute to java element (<java version="1.8+" max-heap-size=1024M java-vm-args="..."/>)

Then I cannot use shortcut on desktop and should open josm.jnlp directly. This is what I've totally found out.

Version 0, edited 6 years ago by anonymous (next)

in reply to:  2 comment:4 by Hb---, 6 years ago

Replying to comment 2:

Applet has been dropped years ago.

Clicking Launch josm.jnlp on / under Windows 7 creates as side effect two JOSM.lnk files. One as Desktop icon and the second as Start Menu item in C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\JOSM\. These .lnk files have the target "C:\Program Files\Java\jre1.8.0_161\bin\javaws.exe" -localfile -J-Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp "C:\Users\<user>\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\56\1ee8cfb8-507a5420"

Aside from OPs question: Will these links break after updating java because of the hard coded javaws location?

Replying to anonym:

As mentioned at JNLP File Syntax I modified the josm.jnlp file in one of these ways and memory allocation worked ...

Thanks for working that out. But it seems that we have easier options.

Then I cannot use shortcut on desktop and should open josm.jnlp directly. This is what I've totally found out.

I could control the memory used with:

  1. Downloading the josm.jnlp file
  2. Open a command prompt (As usually javaws.exe is found in the Path=)
  3. Run javaws -J-Xmx2048m josm.jnlp

Placing a -J before each parameter makes javaws giving them to the virtual machine. Otherwise those parameters are only read by the WebLauncher.

Our Help does not handle this task right in Download#Doubleclickonafiledoesnothing currently. The -Xmx must be preceded by an own -J prefix and must not have an equation sign before the numeric value.

Please feel free to edit the wiki.

in reply to:  1 comment:5 by anonymous, 6 years ago

Replying to Hb---:

I could control the memory used with:

  1. Downloading the josm.jnlp file
  2. Open a command prompt (As usually javaws.exe is found in the Path=)
  3. Run javaws -J-Xmx2048m josm.jnlp

Placing a -J before each parameter makes javaws giving them to the virtual machine. Otherwise those parameters are only read by the WebLauncher.

I tried adding -J-Xmx1024m to the target path of the shortcut on desktop. Nothing happened. No run.

Replying to Hb---:

Are the JAVA run options case sensitive? Did you check https://josm.openstreetmap.de/wiki/Help/CommandLineOptions ?

Then I tried -J-Xmx1024M and it worked! I modified target of shortcut to:

"C:\Program Files\Java\jre1.8.0_161\bin\javaws.exe" -J-Xmx1024M -localfile -J-Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp "C:\Users\<UserName>\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\56\1ee8cfb8-6314d71c"

Thank you man!

comment:6 by Don-vip, 6 years ago

Component: Core WebstartWiki content

mmm, this clearly needs to be documented :)

comment:7 by Hb---, 6 years ago

Keywords: command line options added
Resolution: fixed
Status: newclosed

comment:8 by richlv, 5 years ago

Not sure how to best put it in the wikipage, dropping info here for now in case it helps somebody.
On a Mac, when using webstart, I managed to change the memory limit by editing ~/Library/Application\ Support/Oracle/Java/Deployment/cache/6.0/bundles/JOSM.app/Contents/Info.plist.

There was a WebStartArgs key like this:

        <key>WebStartArgs</key>
        <array>
                <string>-localfile</string>
                <string>-online</string>
                <string>-J-Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp </string>
                <string>/Users/<username>/Library/Application Support/Oracle/Java/Deployment/cache/6.0/56/1ee8cfb8-615850a3</string>
        </array>

Added one line (6th; cannot get line highlighting to work) to make it look like this:

        <key>WebStartArgs</key>
        <array>
                <string>-localfile</string>
                <string>-online</string>
                <string>-J-Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp </string>
                <string>-J-Xmx3048M</string>
                <string>/Users/richlv/Library/Application Support/Oracle/Java/Deployment/cache/6.0/56/1ee8cfb8-615850a3</string>
        </array>

In JOSM, this can be validated by checking reported memory before/after changes in Help -> Show Status Report.

No idea how well will this survive upgrades, will see in a few weeks.

Last edited 5 years ago by richlv (previous) (diff)

in reply to:  8 comment:9 by Hb---, 5 years ago

Replying to richlv:

On a Mac, when using webstart, I managed to change the memory limit by ...

The current https://josm.openstreetmap.de/download/josm.jnlp line number 23 should be:
<java version="1.8+" max-heap-size="2048m" 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/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=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"/>

Is this line present in the josm.jnlp file on your system?

So your editing would increase the heap from 2048 MB to 3048 MB?

comment:10 by richlv, 5 years ago

Sorry, I'm I'm not sure where the jnlp file is by now.
Yes, 3048 is an obvious quick test by changing the first digit only :)

Last edited 5 years ago by richlv (previous) (diff)

comment:11 by Don-vip, 5 years ago

We can document this, but keep in mind Oracle Java WebStart is going away (end of 2020). We'll see with OpenWebStart how to configure things properly :)

comment:12 by Don-vip, 4 years ago

Component: Wiki contentCore Webstart

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.