Modify

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 simon04, 4 years ago

In 17728/josm:

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

comment:2 by simon04, 4 years ago

Resolution: fixed
Status: assignedclosed

In 17729/josm:

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

comment:3 by Stereo, 4 years ago

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 by simon04, 4 years ago

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

comment:5 by simon04, 4 years ago

Resolution: fixed
Status: reopenedclosed

In 17826/josm:

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

comment:6 by simon04, 4 years ago

In 17827/josm:

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

comment:7 by Stereo, 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 Stereo, 4 years ago

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

comment:9 by Stereo, 4 years ago

Owner: changed from simon04 to Stereo
Status: reopenednew

comment:10 by simon04, 4 years ago

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 by simon04, 4 years ago

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain simon04.
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.