Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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 2539 times)
0 Members and 1 Guest are viewing this topic.
Offline Abuse

JGO Coder


Medals: 11


falling into the abyss of reality


« Posted 2006-10-04 14: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) ?

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline caraiz

Senior Newbie




Java games rock!


« Reply #1 - Posted 2006-10-04 15: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 Member




Java games rock!


« Reply #2 - Posted 2006-10-04 15: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.
or
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 Coder


Medals: 11


falling into the abyss of reality


« Reply #3 - Posted 2006-10-13 13: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.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (22 views)
2014-07-24 01:59:36

Riven (20 views)
2014-07-23 21:16:32

Riven (17 views)
2014-07-23 21:07:15

Riven (20 views)
2014-07-23 20:56:16

ctomni231 (48 views)
2014-07-18 06:55:21

Zero Volt (44 views)
2014-07-17 23:47:54

danieldean (35 views)
2014-07-17 23:41:23

MustardPeter (38 views)
2014-07-16 23:30:00

Cero (53 views)
2014-07-16 00:42:17

Riven (52 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org 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‑gaming.org
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!