由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Wrap up -Re: Question: OutOfMemoryError
相关主题
Question: OutOfMemoryError when drawImag紧急求助: java OutOfMemoryError
OutofMemoryError: Java Heap Spacejava.lang.OutOfMemoryError: Java heap space in DB query
Re: Question: OutOfMemoryError when drawWhere I can find comparison of JVMs
java 6要来了[转载] create gif/png image in C or java
为什么java没有destructorAn experiment with JVM Garbage Collection Schemes
请教:AXIS 1.4 webservice client using a proxyStack Frame of your JVM implementation
Static就是个混球The shape of JVM stack frame
Java Resource一问Top Ten Errors Java Programmers Make(10)
相关话题的讨论汇总
话题: image话题: wrap话题: question话题: waitforid
进入Java版参与讨论
1 (共1页)
g**********y
发帖数: 14569
1
Thanks all your guys' help!
Finally I dig it out: in MediaTracker.addImage(Image, int), I add a constant 0
as image ID, and waitForID(0) every time.
Somehow, JVM messed up there and can't release the resources even I request
Image.flush().
Now I change it to addImage(image, m_counter), and waitForID(m_counter), plus
that Image.flush(). JVM release graphics resources now.
KG
发帖数: 515
2
If u use ImageIcon, u don't have to bother MediaTracker.

【在 g**********y 的大作中提到】
: Thanks all your guys' help!
: Finally I dig it out: in MediaTracker.addImage(Image, int), I add a constant 0
: as image ID, and waitForID(0) every time.
: Somehow, JVM messed up there and can't release the resources even I request
: Image.flush().
: Now I change it to addImage(image, m_counter), and waitForID(m_counter), plus
: that Image.flush(). JVM release graphics resources now.

xt
发帖数: 17532
3

It is not surprising that after you call addImage() it will add
that image onto the component without removing others. To my
understanding addImage means you add the image to a list of
the images the compnent holds. Therefore the component still keeps
the references to other images you no longer need after you add a
new image into it. You need to remove the images from that list
to save memory.
As for me, I would use a single Image object and dynamically change the
Graphics object associated wi

【在 g**********y 的大作中提到】
: Thanks all your guys' help!
: Finally I dig it out: in MediaTracker.addImage(Image, int), I add a constant 0
: as image ID, and waitForID(0) every time.
: Somehow, JVM messed up there and can't release the resources even I request
: Image.flush().
: Now I change it to addImage(image, m_counter), and waitForID(m_counter), plus
: that Image.flush(). JVM release graphics resources now.

1 (共1页)
进入Java版参与讨论
相关主题
Top Ten Errors Java Programmers Make(10)为什么java没有destructor
Is this a Bug or not?请教:AXIS 1.4 webservice client using a proxy
Answer to "Is this a Bug or not? "Static就是个混球
Answer 2 to "Is this a Bug or not? "Java Resource一问
Question: OutOfMemoryError when drawImag紧急求助: java OutOfMemoryError
OutofMemoryError: Java Heap Spacejava.lang.OutOfMemoryError: Java heap space in DB query
Re: Question: OutOfMemoryError when drawWhere I can find comparison of JVMs
java 6要来了[转载] create gif/png image in C or java
相关话题的讨论汇总
话题: image话题: wrap话题: question话题: waitforid