#20733 closed defect (fixed)

macOS: ImageResource for 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


Regression of r17488. 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 Changed 14 months ago by simon04

In 17728/josm:

see #20733 - ImageProvider: do not upscale non SVG images for HiDPI

comment:2 Changed 14 months ago by simon04

Resolution: fixed
Status: assignedclosed

In 17729/josm:

fix #20733 - PlatformHookOsx: use logo.svg in 256x256 size

comment:3 Changed 14 months ago by Stereo

Resolution: fixed
Status: closedreopened

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 Changed 13 months ago by simon04

@Stereo, which resolution is required for logo-macos.png – 1024x1024 seems to be an overkill?

comment:5 Changed 13 months ago by simon04

Resolution: fixed
Status: reopenedclosed

In 17826/josm:

fix #20733 - PlatformHookOsx: use logo_macOS.png in 256x256 size

comment:6 Changed 13 months ago by simon04

In 17827/josm:

see #20733 - ImageProvider: do not rescale non SVG images when already correctly sized

comment:7 Changed 13 months ago by Stereo

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 Changed 13 months ago by Stereo

Component: CoreInstaller MacOS
Milestone: 21.04Longterm
Priority: normalminor
Resolution: fixed
Status: closedreopened

comment:9 Changed 13 months ago by Stereo

Owner: changed from simon04 to Stereo
Status: reopenednew

comment:10 Changed 13 months ago by simon04

Milestone: Longterm21.04
Owner: changed from Stereo to simon04
Priority: minornormal

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 Changed 13 months ago by simon04

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain simon04.
as The resolution will be set.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.