Opened 4 years ago
Closed 4 years ago
#20733 closed defect (fixed)
macOS: ImageResource for https://josm.openstreetmap.de/logo-macos.png is wasting 25MB on the heap
Reported by: | simon04 | Owned by: | simon04 |
---|---|---|---|
Priority: | normal | Milestone: | 21.04 |
Component: | Installer MacOS | Version: | |
Keywords: | template_report heap profiling intellij yourkit macos | Cc: | Stereo, GerdP, Don-vip |
Description
Regression of r17488. https://josm.openstreetmap.de/logo-macos.png has a dimension 1024x1024.
- Why do we need to download an essential image via HTTP?
- Why does the icon need to be so huge? 1024x1024
- Why cannot we use an SVG?
Due to HiDPI upscaling the icon to 2x, in addition, a 2048x2048 variant is stored in memory. This is is useless and simple to fix.
Attachments (0)
Change History (11)
comment:1 by , 4 years ago
comment:3 by , 4 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
The live downloading was done at @don-vip's request. I'd be happy with either philosophically, and 25MB of heap to save a 79K download does indeed sound like a bad tradeoff to me.
If I understand your change correctly, you're using the default logo.svg instead of the macOS icon. logo-macos.png or the svg version should be bundled and used instead.
comment:4 by , 4 years ago
@Stereo, which resolution is required for logo-macos.png – 1024x1024 seems to be an overkill?
comment:7 by , 4 years ago
Sorry I missed this. Icons on macOS can indeed be quite large in pixels, especially when navigating in the Preview panel in the Finder. On a retina display, 512x512 gets upscaled to 1024.
This png icon isn't the app icon shown in the Finder though - it is used after startup, to set the icon in the dock. We already bundle a perfectly good icon pack in the .app (JOSM.icns), but the minority of users who use the .jar won't have it.
I wonder if there would be a way to detect how JOSM is being launched, to only substitute the low-res icon if strictly necessary.
comment:8 by , 4 years ago
Component: | Core → Installer MacOS |
---|---|
Milestone: | 21.04 → Longterm |
Priority: | normal → minor |
Resolution: | fixed |
Status: | closed → reopened |
comment:9 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
comment:10 by , 4 years ago
Milestone: | Longterm → 21.04 |
---|---|
Owner: | changed from | to
Priority: | minor → normal |
Please leave this ticket closed as its mentioned in the milestone changelogs and contributed major heap savings. For further improvements, please open a separate longterm ticket. Thank you!
comment:11 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
In 17728/josm: