B4J Question Java heap space

Tayfur

Well-Known Member
Licensed User
Longtime User
Hello;
My app loading in mylist all pictures.
I trying big sized pictures from lan. (1-2mb). When I loaded 3 pcs , I read some error like under below.
How can fix it.

it s broken line on "initialize."
B4X:
Dim bmp As Image
bmp.Initialize2(File.OpenInput(xDir,xName))

I've tried uploading a lot of pictures. (size 300Kb) but it s not broken.
I've tried uploading 2 PNG pictures. (size 1640Kb) After app broked when I added 3. PNG picture.
all png pictures are same file.

 
Last edited:

Tayfur

Well-Known Member
Licensed User
Longtime User
Upvote 0

stevel05

Expert
Licensed User
Longtime User
That is the command line option, within the ide you just need :
B4X:
#VirtualMachineArgs: -Xmx2048m
 
Upvote 0

Tayfur

Well-Known Member
Licensed User
Longtime User
That is the command line option, within the ide you just need :
B4X:
#VirtualMachineArgs: -Xmx2048m
I tried it. And results is very very interesting. Java burning...

I tested with 30pcs.




Some time disk usage rate 100%
CPU rate 75%
after broken code.


 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
If you are loading multiple images, you will have to try managing them. one option would be to download one at a time, save it to disk the loadbitmapSample to display a smaller view of each.
 
Upvote 0

Tayfur

Well-Known Member
Licensed User
Longtime User
If you are loading multiple images, you will have to try managing them. one option would be to download one at a time, save it to disk the loadbitmapSample to display a smaller view of each.


I added sample project ; with out image.

image size : 9933x7016




New
If you are loading multiple images, you will have to try managing them. one option would be to download one at a time, save it to disk the loadbitmapSample to display a smaller view of each.
But i need to learn real image size. Therefore "bmp.Initialize2(File.OpenInput(xDir,xName))"
 

Attachments

  • test2.zip
    16.8 KB · Views: 238
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…