This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Is this Memory Lekage? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Reply Bookmark "Is this Memory Lekage?" Watch "Is this Memory Lekage?" New topic
Author

Is this Memory Lekage?

vishwas bhatt
Ranch Hand

Joined: Nov 30, 2000
Posts: 129
Hi folks,

Image img;

img = Image.createImage("/a.png");
img = Image.createImage("/b.png");
img = Image.createImage("/c.png");
img = Image.createImage("/d.png");

is this memory lekage in j2me or java.Will it create memory fregmentation on heap.
Or i have to make first img = null and then asign new Image
Michael Yuan
author
Ranch Hand

Joined: Mar 07, 2002
Posts: 1427
No, it is not. When the img variable is assigned to the second Image instance, the first Image instance is no longer linked in the object graph and ready for garbage collection.


Seam Framework: http://www.amazon.com/exec/obidos/ASIN/0137129394/mobileenterpr-20/
Ringful: http://www.ringful.com/
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Is this Memory Lekage?
 
Similar Threads
Is there Memory leak..?
Inserting a image with J2ME
Re: Create Image in J2ME
images in palm
Where do I put images in J2me application