Josm on Ubuntu update the executable and make it use more memory

Things you can do to update Josm on Ubuntu and how to make Josm use more memory.

To find out how much memory you have in your Linux computer.
The /proc file system has information about your computer.
There are many memory values listed.
For the first memory measurement, make sure Josm is not running.

cat /proc/meminfo


MemTotal: 3311836 kB
MemFree: 1470652 kB
MemAvailable: 2071568 kB
Buffers: 34308 kB
and more…

Now start Josm and run the memory information page again.

MemTotal: 3311836 kB
MemFree: 129060 kB
MemAvailable: 192160 kB
Buffers: 15272 kB

Next, here is how I start Josm with a larger amount of memory.
Again from a terminal. You can see I am doing this as a regular user from my openstreet sub directory

:~/openstreet$ java -Xmx2048m -jar /usr/share/josm/josm.jar

Finally, here is how I upgrade from Ubuntu’s fairly old version of josm.jar
Be very careful with “sudo”. Try each command without sudo so you can be sure you typed correctly

Again from a terminal. Check your Java version.

~/openstreetjava -version
openjdk version “11.0.11” 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

Next From the Josm program page saying “download” , download the latest Josm file.
My downloads all go to Downloads.

Copy the downloaded “josm-tested.jar” file to the following directory

cd /usr/share/josm

Look at the directory with ls -l. See two things to deal with

The yellow color entry is a soft link.
Our new josm-tested.jar file has the wrong owner.
ls -l
drwxr-xr-x 2 root root 12288 Jan 19 22:53 data
-rw-r–r-- 1 root root 15286732 Dec 29 2020 josm-1.5.svn17428.jar
lrwxrwxrwx 1 root root 15 Jul 8 23:24 josm.jar → josm-1.5.svn17428.jar
-rw-r–r-- 1 user user 15813993 Jul 8 23:11 josm-tested.jar

Test out your downloaded file before we modify owner names.
java -jar josm-tested.jar

Change owner of the new file. Try the command without sudo first.

sudo chown root:root josm-tested.jar

Delete the existing soft link to the name josm.jar
sudo rm josm.jar

Recreate the soft link josm.jar now points to the new Josm-tested.jar
sudo ln -s josm-tested.jar josm.jar

Finally I have tried getting aggressive to make josm use lots of memory.
First here is a better way o watch the memory used by Josm
cat /proc/meminfo | grep Buffers
Buffers: 391696 kB

In another terminal session start Josm with a trial large memory setting

java -Xmx8096m -jar /usr/share/josm/josm.jar

Repeat the memory check (in a separate terminal

lmckusic@wayback:~$ cat /proc/meminfo | grep Buffers
Buffers: 392944 kB

Subtracting the numbers shows 1248 KB difference. Not quite right.
But at least Josm can now load a 616 MB extract file.
However, with that file Josm takes minutes for the display to fill with data.