Replies: 2 comments 2 replies
-
|
Thanks for opening this discussion as this has big impact on our RCP app on Windows when using many images. @HeikoKlare Is this something that could be improved? |
Beta Was this translation helpful? Give feedback.
-
This is based on some simple tests and on what @Phillipus reported is his product.
This pretty much relates to what you explained below. The image data seems to exists both in the cache (and therefore on the Java heap), but also in a native resource. In other words: It's stored twice in memory.
Which I don't think is happening. This is also the reason why I specifically looked at the memory consumed by the process, not just the Java heap. Otherwise I can't explain why there's such a big difference between using an
This method specifically is never called in the snippet above. I even set a breakpoint in this method, but it's never hit. Instead, I only get this call stack:
|
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
This is a topic that came up here with regards to the image data that is cached by an
Image, in case anImageDataProvideris used.For example, take the following snippet:
Snippet
This example introduces 550MB of image data which is stored on the heap.
...which is used almost exclusively held by the
cachedImageDatamap.The entire process takes up 1.6GB of memory.
When I create the image without
ImageDataProvider, the Java heap is nonexisent and the process only needs 1.2GB of memory. The underlying "problem" is that this cache is never cleared. So images with a long lifecycle now require (at least) 50% more memory, and will stay like that until eventually they are disposed. I also think the image data is redundant, because the same data is already stored in the native widget.This overhead primarily exists on Windows, which I assume was done as part of the HiDPI support, in order to avoid the performance impact when the monitor zoom has changed and thus the images need to be updated. But perhaps there's a better way handle this?
Maybe it would already help if:
This might already be improved with #3429 but you'd still get the issue if the provider supports multiple zoom levels.
Beta Was this translation helpful? Give feedback.
All reactions