Is there way for B4J Java app to use ... much RAM memory for work with raster bitmaps ?
I mean - to check the available RAM on the PC and use in Java app, say, 30%.
If user is using really big raster bitmaps (photos to be viewed with zoom in and out), and PC is with lots of GB of RAM - how to correctly let him use it without the RAM memory issue as here ?
You could set -Xms and -Xmx but you need to set them before your app starts (you cant see how much memory you have, then try to set them from your app). #VirtualMachineArgs
I have tried to set "-Dprism.maxvram=2G" - and zooming now is 5.5 times wider without those error.
The Windows Task manager shows really bigger used RAM of the process.
When you zoom in are you actually drawing a bigger image?
What I mean is if image is 100 x 100 and you zoom 2x - does the image end up at 200 x 200.
An alternative is to use imageview with a veiwport.
If the image is 100 x 100 and imageview is 100 x 100 and viewport is 100 x 100 = zoom x1
If you change viewport to 50 x 50 = zoom x2
If you change to 10 x 10 = zoom x10
and it doesnt use more memory as the imageview stays the same size. If you use canvas you could snapshot the imageview and put into canvas.
I use Erel's ZoomImageView class, 2 pcs on the screen.
And the subject is about really big photos (of the PCB that can be big), say, like 4K x 3K area, and at FullHD monitor they are zoomed from say 0.2 to 15.
And anyway the photos sizes depend on user's choice.