Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#20578 closed defect (fixed)

JOSM is out of memory - While adding a local xml preset

Reported by: HeinerSchaefer Owned by: team
Priority: normal Milestone: 21.03
Component: Core Version:
Keywords: performance preset reference loop out of memory Cc: simon04

Description

I built a preset to edit trees and tree rows in OSM.
It's working fine so far.

The I've done some changes and got the following error message:

JOSM is out of memory. Strange things may happen. ...

I started trouble shooting by deleting blocks.
The original preset has more than 2000 lines.
Now I have a preset with 81 lines and the error.
And I don't know why!

This issue happens on two installations, one Ubuntu, one Debian.
JOSM Version: 17428
Java-Version 11.0.10

Attachments (4)

JOSM-Preset_TreeRows-short_MemError.xml (3.9 KB ) - added by HeinerSchaefer 4 years ago.
Very short version of the preset. Memory Error should come up.
JOSM-Preset_Trees_only.xml (91.2 KB ) - added by HeinerSchaefer 4 years ago.
Much longer preset, not for tree rows, but for trees. No error here.
20578.patch (819 bytes ) - added by GerdP 4 years ago.
simple check for stack size
error-popup.PNG (10.0 KB ) - added by GerdP 4 years ago.

Download all attachments as: .zip

Change History (16)

by HeinerSchaefer, 4 years ago

Very short version of the preset. Memory Error should come up.

by HeinerSchaefer, 4 years ago

Attachment: JOSM-Preset_Trees_only.xml added

Much longer preset, not for tree rows, but for trees. No error here.

comment:1 by GerdP, 4 years ago

This part looks like a recursive definition. tree-row-keys -> tree-row-keys

    <chunk id="tree-row-keys">
        <reference ref="tree-row-keys" />
        <text key="name" text="Name" />
        <text key="height" text="Height (meters)" />
        <text key="start_date" text="Start date" />
    </chunk>

Not sure if that's correct but it might trigger such a memory problem.

comment:2 by HeinerSchaefer, 4 years ago

Resolution: fixed
Status: newclosed

This is the fixed part:

    <chunk id="tree-row-keys">
        <key key="natural" value="tree_row" />
        <text key="name" text="Name" />
        <text key="height" text="Height (meters)" />
        <text key="start_date" text="Start date" />
    </chunk>

This chunk was called recursive.
Copy-Paste-Problem!

comment:3 by GerdP, 4 years ago

Resolution: fixed
Status: closedreopened

I think it would be good if JOSM would recognize this error

comment:4 by skyper, 4 years ago

+1, I had the same thought.

comment:5 by skyper, 4 years ago

Keywords: performance preset reference loop out of memory added

comment:6 by HeinerSchaefer, 4 years ago

+1, OK, with a speaking error message this should really help. Closed too fast, sorry.

by GerdP, 4 years ago

Attachment: 20578.patch added

simple check for stack size

by GerdP, 4 years ago

Attachment: error-popup.PNG added

comment:7 by GerdP, 4 years ago

The patch produces this popup for the bad example:

comment:8 by GerdP, 4 years ago

Cc: simon04 added

comment:9 by GerdP, 4 years ago

The default presets never reach a stack size of more than 5 so I guess a threshold of 100 is a reasonable value. I assume it is possible to define more complex loops where a refers to b and b refers to c and c refers to a (similar to relations in OSM), so a perfect solution would show all elements that form the recursive dependency loop, but this would require much more code.

comment:10 by simon04, 4 years ago

I like the simple solution from attachment:20578.patch

This is the first time an error w.r.t. recursive chunks has been reported since its introduction in r6558, so we probably don't super advanced error handing.

comment:11 by GerdP, 4 years ago

Resolution: fixed
Status: reopenedclosed

In 17636/josm:

fix #20578: JOSM is out of memory - While adding a local xml preset

  • add simple check for stack size

comment:12 by GerdP, 4 years ago

Milestone: 21.03

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.