#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)
follow-ups: 3 5 comment:1 by , 7 years ago
follow-up: 4 comment:2 by , 7 years ago
Component: | Applet → Core Webstart |
---|
Applet has been dropped years ago. Please don't use this component.
comment:3 by , 7 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.jnlp
file in one of these ways and memory allocation worked:
- Adding
-Xmx1024m
argument tojava-vm-args
. - Adding
max-heap-size=1024M
attribute tojava
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.
comment:4 by , 7 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:
- Downloading the josm.jnlp file
- Open a command prompt (As usually javaws.exe is found in the Path=)
- 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.
comment:5 by , 7 years ago
Replying to Hb---:
I could control the memory used with:
- Downloading the josm.jnlp file
- Open a command prompt (As usually javaws.exe is found in the Path=)
- 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 , 7 years ago
Component: | Core Webstart → Wiki content |
---|
mmm, this clearly needs to be documented :)
comment:7 by , 7 years ago
Keywords: | command line options added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
follow-up: 9 comment:8 by , 6 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.
comment:9 by , 6 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 , 6 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 :)
comment:11 by , 6 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 , 5 years ago
Component: | Wiki content → Core Webstart |
---|
Are the JAVA run options case sensitive? Did you check https://josm.openstreetmap.de/wiki/Help/CommandLineOptions ?