You Are Here:

Community: Developer Discussion Boards

#1 Old Memory fragmentation - 2004-06-15, 12:03

Join Date: Oct 2003
Posts: 11
Ludvig1971
Offline
Registered User
Hi everybody !

I'm working on a RPG, and I'v got this problem
with memory fragmentation.

I'v got a quite big bitmap with tiles, and
sometimes I'll load a new one, like
this:

ITiles=null;
try{ ITiles=Image.createImage("/gfx/tileset"+nr+".png");
}catch(Exception e){
//System.out.println("LoadTiles Exception: "+e);
};

or like this :

ITiles=null;
System.gc(); //<-
try{ ITiles=Image.createImage("/gfx/tileset"+nr+".png");
}catch(Exception e){
//System.out.println("LoadTiles Exception: "+e);
};


I can do this about 17 times before
there are no more memory left...
I'm not having any other 'new' or other
memoryconsuming parts, so I deduced
that the memory is getting fragmented.

So my question is, how can I do this better ?
I would like to only 'overwrite' the image with
another one (they all have the
same size).

Is there a possible workaround ?


Thanks !

/Ludvig Larsson

ps. I'm currently working on the 3650.
Reply With Quote

#2 Old 2004-06-23, 13:11

Join Date: Mar 2003
Posts: 1
eirplaygames
Offline
Registered User
as far as i know the garbage collector isn't called that often on the phone.
try calling it after you set the previous image to null, just to make sure.
[System.gc();]

also, if the images are tiles are they the same size?
if they are different sizes this will fragment the memory much quicker.
Last edited by eirplaygames : 2004-06-23 at 13:23.
Reply With Quote

#3 Old 2004-06-23, 14:27

Join Date: Oct 2003
Posts: 11
Ludvig1971
Offline
Registered User
Thanks but I'v tried all sort of
combinations, and there
are IMHO no easy workaround possible...

/Ludvig
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ