Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (780)
Games in Android Showcase (233)
games submitted by our members
Games in WIP (857)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  NokiaN90 leaks native memory when using Image.createRGBImage(...)?  (Read 3868 times)
0 Members and 1 Guest are viewing this topic.
Offline Abuse

JGO Ninja

Medals: 71

falling into the abyss of reality

« Posted 2006-10-04 12:59:40 »

After~20minutes of play, a dozen or so level transitions, and probably several hundred calls to image.getRGB(...) & Image.createRGBImage(...) - the handset will begin to throw an OutOfMemoryError from canvas.serviceRepaints().

This doesn't appear to occur when getRGB/createRGBImage are not used.

Has anybody encountered this or similar issues on the N90 (or similar handsets) ?
Offline caraiz

Senior Newbie

Java games rock!

« Reply #1 - Posted 2006-10-04 13:12:46 »

Symbian phones sucks a lot, with a lot of bugs, some of them still since version 7.

I dont sure about N90, but many (or all?) symbian phones have problems when you use transform in drawRegion.
If the problem is that, u can use NokiaUI api to solve it. Nokia dont recomment it, but..... it works.

Offline OverKill

Junior Devvie

Java games rock!

« Reply #2 - Posted 2006-10-04 13:31:03 »

Leak would be the wrong word. All images you load directly are set to native memory (yes, bob, bigger, better, slices, dices). When you try to free them, only the handle is freed, not the memory.
I think nokia defines it as a 'feature'.

Many symbian phones have that feature though I cannot say how many due to lack of testing.
Best thing is to write a  midlet that fills up memory with images, release a few and then try to load one again.
If it works for as many as you removed (might have gotten lucky and it freed up enough), great.
If not, it has the 'feature'.

One version is to load everything once.
as you wrote, use either the midp 2.0 rgb feature (would work for all midp2.0 devices) or nokias direct graphics stuff (would work for all nokias + has some nice features).
But if you do it this way, do NOT load the images as pngs! Like I wrote above, the leak is the image!
Dump the contents to a file (compress just as well as a png) and load the file (which is loaded to java heap).

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Abuse

JGO Ninja

Medals: 71

falling into the abyss of reality

« Reply #3 - Posted 2006-10-13 11:04:08 »

It turns out the cause of the memory leak was getDirectGraphics(...).

It was being called once per paint, but the returned DirectGraphics object was never being accessed.
Pages: [1]
  ignore  |  Print  

hadezbladez (748 views)
2018-11-16 13:46:03

hadezbladez (387 views)
2018-11-16 13:41:33

hadezbladez (740 views)
2018-11-16 13:35:35

hadezbladez (195 views)
2018-11-16 13:32:03

EgonOlsen (2398 views)
2018-06-10 19:43:48

EgonOlsen (2562 views)
2018-06-10 19:43:44

EgonOlsen (1483 views)
2018-06-10 19:43:20

DesertCoockie (2146 views)
2018-05-13 18:23:11

nelsongames (1952 views)
2018-04-24 18:15:36

nelsongames (2631 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!