Garbage Collecting and freeing memory in JTree
Suppose you have a JTree with a model that takes a lot of memory. after you are finished using the tree you want to free this memory. so you go on and use the
tree.setModel(null) method, hoping everything will be fine. to be extra sure you even set the root to null.
what happens is that the tree view is cleared but the memory isn't.
my conclusion is that somwhere in the tree package there are refrences to the tree root, model or whatever that keeps it from been garbage collected. to make sure my code doesn't keep any refrences to the tree model I am using a very thin class that only instantiates a tree and fills it with data. this class keeps no members, listeners, refrences and so on.
calling system.gc() does nothing.
Is there a simple way to clear memory in a JTree ?
without using weak refrences and other unwanted complexities.
Hi, thanks for the response.The C API version is 6.5.3 or 6.5.4.2, depending on the environment.I'll paste the code in here, but it is completely based on the sample programs so I'm not sure where else we could free up memory (any insights appreciated!):ESS_MEMBERINFO_T *pChildMemberInfo = NULL;sts = ESS_Init();if(sts == ESS_STS_NOERR){ sts = ESS_Login(srvrName, adminUserName, password);if(sts == ESS_STS_NOERR){// set the active dbsts = EssSetActive(hCtx, appName, dbName, &Access);if(sts == ESS_STS_NOERR){memset(&Object, '\0', sizeof(Object));// open the outline for use in subsequent callsObject.hCtx = hCtx;Object.ObjType = ESS_OBJTYPE_OUTLINE;Object.AppName = appName;Object.DbName = dbName;Object.FileName = dbName;sts = EssOtlOpenOutline(hCtx, &Object, ESS_FALSE, ESS_FALSE, &hOutline);if(sts == ESS_STS_NOERR){// get member names from outline, so// this section includes a number of // sts = EssGetMemberInfo(hCtx, // category, &pChildMemberInfo);// calls to query member names.// Then some calls are made to free // these resources:if(pChildMbrInfo){EssOtlFreeStructure(hOutline, 1, ESS_DT_STRUCT_MBRINFO, pChildMbrInfo);}if(pChildMemberInfo){EssFree(hInst, pChildMemberInfo);}EssOtlCloseOutline(hOutline);}}ESS_Logout();}ESS_Term();}
Similar Messages
-
Garbage Collection not releasing memory properly
Hello, In my web application memory is not releasing properly, after some point of time application throw out of memory error, we are using tomcat5, jdk5, my heap size is half of the RAM.Garbage Collection not releasing memory properly.
sabre150 wrote:
punter wrote:
georgemc wrote:
Yep. Couldn't be a problem with your code, it must be that garbage collection doesn't work and nobody else noticed. Raise a bug with Sun.Are you serious ?You need to replace your sarcasm detector.I have blowed my sarcasm meter and limping in the blindness !!!! :( -
No garbage collection data/detailed memory use data in Wily?
Hi All,
We are running some portals on AIX (1.4.2 SR12). We have installed the wily agent on the portals and the enterprise manager on our solman server. When looking in the introscope workstation the heap usage of the JVMs are shown as it should. However, the J2EE GC Overview 1/2 & 2/2 don't show any detailed data regarding garbage collection and memory usage (e.g. tenured; eden; etc...). At this moment we use IBM PMAT for memory analysis, but this is not real time. We would like to see memory details real time using Wily.
Does anyone else also encounters this problem?
Any suggestions?
Thanks,
Bart.Hello Amit
Can you please open new thread for your question ?
People won't check this thread to answer your question because the thread is marked "answered".
Kind regards
Tom -
Garbage Collection and Constant CPU Usage
Hello,
We have a load balanced environment running ColdFusion 10 Enterprise with 5 instances currently running. Currently we only have one instance being actively used but have been encountering a problem within a time frame of 12 to 36 hours (calculated on the times we have had to restart CF to come back online) the garbage collection is running almost constantly and CPU holds at 50% until the server just becomes unresponsive until the CF instance is restarted.
I have been monitoring the server via VisualVM to watch the CPU and Heap usage since I have found that running the server monitoring systems build into CF 10 Enterprise accelerate the problem to cause a crash within 4 to 5 hours.
This issue has been occuring regardless if there is heavy load or not on the server. I have been seeing some odd behaviour when running CF Stat where I am seeing 4 Requests Queued and Running Requests never shows anything other than 0. I increased the Minimum Heap Size to 512 MB and Maximum Heap Size to 1024 MB and below is our JVM arguments
-server -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.home={application.home} -Dcoldfusion.rootDir={application.home} -Dcoldfusion.libPath={application.home}/lib -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true -Dcoldfusion.jsafe.defaultalgo=FIPS186Random -Dcom.sun.management.jmxremote.port=8701 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
We are running on a Windows 2008 64 Bit and IIS 7.5 on both of the load balanced servers and have updated the server to ColdFusion 10 Update 2. I am aware of the issues that are being fixed in Update 3 that was removed last week by Adobe due to bugs introduced.
If anyone has any insight in how to fix this issue, I would be greatly appreciative. This is affecting a production server that did not show these problems when we put the servers under load when we did pre launch settings.Further from your images - while it shows CF CPU at 50% the GC activity is 0%.
So could be your not garbage collecting more than necessary and something else CF wise is taking CPU time.
What would be interesting is the Jconsole Memory tab Details section. It shows the time spent in minor and major GC's. eg:
HTH, Carl. -
Garbage collection and closure
I am running a remote script from bridge that opens a complex dialog in photoshop. I need to run the dialog in photoshop because it displays fonts, styles and actions, which are not available in bridge.
When I close the dialog I return to my bridge script. If I repeated open the remote script with the complex dialog I continue to use up resources and the dialog opens more slowly each time.
If I run the remote script directly from the ESTK I still lose reources and it slows down, but not as significantly as when run as a remote script via bridgetalk.
I think this is caused by inner functions in my dialog, which are creating closures, which in turn are preventing garbage collection.
Has anyone experienced this and do you have any tips to prevent the performance degradation?Rory,
I've never seen that before. In PS, the script that displays the dialog executes, then the engine that ran it supposed to be destroyed. Should be no need for garbage collection. Running the script directly in ESTK still uses BridgeTalk, so I would expect little difference.
I'd be curious to know what's happening because each time you run the script, it should be using a fresh scripting engine in PS. Perhaps there's something preventing PS from releasing the engine when BridgeTalk is involved. It that's the case, it would be a bug.
I do have a suggestion - instead of switching to PS, why not ask PS to give you lists of fonts, styles, and actions? You could write a script that put all three into a an array:
// up here create the arrays
var a = new Array();
a[0] = fontArray;
a[1] = styleArray;
a[2] = actionArray;
a.toSource();
eval'ing the message body in the onResult handler would give you all the info you needed to show your dialog in Bridge. Both Bridge and PS use scriptUI, so the dialog you have written should work in either (once you get the information necessary to display it in Bridge). -
How often is garbage collected and can I control it.
The code I write tends to have a lots of graphics, video, audio all that stuff that uses lots of memory so I need to tidy up after myself. Are there any commands that force immediate collection? Any recommendations appriciated.
So I would need CS4 to explicitly control? I found a interesting link about garbage http://gskinner.com/talks/resource-management/ I also read that gc happens very differently in IE than FF which seems odd as they both use the same vm.
-
ByteBuffer.allocateDirect vs. NewDirectByteBuffer and freeing memory
Hi all, I have a very basic question that I'm afraid I couldn't find in any documentation. My question is, when a ByteBuffer in my JVM wraps a direct memory buffer does it try to free that native memory when it gets GC'd? It seems like it would have to do this when I (the user) create it via ByteBuffer.allocateDirect; but if I use a JNI call into NewDirectByteBuffer, I understand that I'm taking responsibility for freeing that memory when I'm finished with it. Both will return true for isDirect(), but in the case where I created the buffer myself and passed it to NewDirectByteBuffer, then free'd that memory myself, will the ByteBuffer object know that it's not supposed to free that memory?
Thanks in advance.koverton wrote:
Hi all, I have a very basic question that I'm afraid I couldn't find in any documentation. My question is, when a ByteBuffer in my JVM wraps a direct memory buffer does it try to free that native memory when it gets GC'd? Yes, but I have found it does this very slowly. i.e. When the JVM runs low on heap space it will GC before it throws an OutOfMeoryError However for non-heap space this doesn't happen so reliably.
It seems like it would have to do this when I (the user) create it via ByteBuffer.allocateDirect; but if I use a JNI call into NewDirectByteBuffer, I understand that I'm taking responsibility for freeing that memory when I'm finished with it. Both will return true for isDirect(), but in the case where I created the buffer myself and passed it to NewDirectByteBuffer, then free'd that memory myself, will the ByteBuffer object know that it's not supposed to free that memory?Your best bet is to check the finialize() code. You may be able to break point it to see what it does in your case.
If you are not sure, why not call ByteBuffer.allocateDirect(). -
Ejecting disk issues and freeing memory
Ok, so sometimes the disk gets stuck and I can't find a way to get it to eject. What should I do?
Also, something is taking up space on my macbook pro and I don't know what it is. I deleted unwanted programs, videos, and movies. I still want to free more space. When i click "About this mac" it says 34.22GB free out of 211GB. There is this huge yellow portion that says 61.35 what is that? Thanks.In Mac Help:
If you’re trying to eject a CD or DVD:
Choose Apple menu > Log Out, and then log in again. Try to eject the disc again.
If you still can’t eject the CD or DVD, choose Apple menu > Restart. While your computer restarts, hold down the mouse button or trackpad button until the disc is ejected.
The Yellow portion is a catch all category for items that do not fall into the other ones. Best way to find what you don't want is to down load from the Internet OmniDiskSweeper (free) and open it. It will show you in a sequential format all you files and the space they are taking.
Ciao. -
Reconciling garbage collection, heap overview, and object stats
First, both the JRockit RuntimeAnalyzer and Console are great tools. We use
them extensively so thank you.
I'm trying to reconcile the numbers in these three tabs.
1. How do I reconcile the Runtime Analyzer and Console output?
- The Heap overview tab in our application profile shows Heap Overview as
83% free.
- However, the Garbage Collection tab of the profile and Console shows the
application as oscillating between 50 Meg and 200 Meg of heap used. That's
25% (50Meg/200Meg) to 100%(200Meg/200Meg) used. How do I interpret the 83%
vs. the 100%?
I don't believe the 83% free, but I'm skeptical that we consume 150Meg of
memory in 50 seconds.
2. How do I reconcile the Object stats with the Garbage collection?
- Take the top heap user at end of recording, character buffer. It's 22.8%
of heap using 6,328 KB. If the heap is actually only 34Meg ( 17% of 200Meg.
I get the 17% from the 83% free), then 22.8% makes sense.
- So what's in the 200Meg of heap?
I sent this recording to the JRA team if you want to look at it.
Thanks
JeffI've never heard it put that way. Very interesting.
"Johan Walles" <johan@spamalamadingdong> wrote in message
news:41bf0be3@mail...
Note that the time it takes for the garbage collector to do its thing
grows with the amount of live data.
What the garbage collector really does is more like retaining the live
data than disposing of the garbage.
Regards //Johan
Jeff wrote:
Staffan,
Thanks - you clearly answered my questions. Now the follow-on questions:
1. Is there a way to get insight into what the 'dead' data is composed
of?
2. Is this pattern of consuming 3x the live data in about a minute
'typical' or a disaster in the making?
I'm trying to get a sense of what a reasonable target of 'dead' data is.
The system processes about a meg of data per second, including database
writes.
Thanks
Jeff
"sla" <[email protected]> wrote in message
news:33533893.1102952170368.JavaMail.root@jserv5...
Hi Jeff,
I'll try to answer the questions.
1) The Heap overview in the application profile is a snapshot of the heap
at the end of a garbage collection. At this time only live data is still
on the heap. So it looks like you have 17% of the heap filled with live
data (and some overhead as seen in the Heap overview).
In the garbage collection tab you can see the heap usage oscillating
between 35-40MB and 200MB. The lower value is right after a garbage
collection and the higher value is right before a garbage collection. The
garbage collector clears out about 160MB of "dead" data from the heap.
This is the amount of temporary objects that you created during the
garbage collection cycles.
2) The Object statistics are also taken right after a garbage collection.
At this time there is 34M of live data on the heap and of these about 22%
is taken up by character arrays (not unusual).
At this time the rest of the 200MB heap is empty. It's been cleared of
all temporary objects and is ready for allocation of new objects.
I hope this answered your questions.
Regards,
/Staffan -
Memory Leak / Strange Garbage Collection
Help!
We are having strange problems that appear to be related to a memory leak. The
strange part is that even if we don't hit the site, it appears to leak. Can someone
please explain the output below: Notice how freespace is decreasing, even with
no direct site activity:
[GC 48857K->35514K(130560K), 0.0136978 secs]
[GC 49018K->35548K(130560K), 0.0144821 secs]
[GC 49052K->35550K(130560K), 0.0128796 secs]
[GC 49054K->35549K(130560K), 0.0121789 secs]
[GC 49053K->35547K(130560K), 0.0126394 secs]
[GC 49051K->35582K(130560K), 0.0161642 secs]
[GC 49086K->35770K(130560K), 0.0209171 secs]
[GC 49247K->36005K(130560K), 0.0188181 secs]
[GC 49509K->36198K(130560K), 0.0129967 secs]
etc...
If I understand the numbers correctly, we have less and less free space available.
If anyone has any insights into this it will be greatly appreciated. We have problems
moving into production.
Our environment: Solaris 8, Jdk1.3.1, WL 5.1
ChrisChris - turn off verbose GC and and don't worry about it.
Visit java.sun.com and read all about Java and Garbage Collection and JVMs.
Weblogic does 'stuff' all on it's own even when it is not being accessed - just
like your refrigerator runs when are on vacation - (please tell me you don't worry
about that too). Objects get created and deleted. There is no pressing need for
the garbage collector to recover every scrap of unused memory - so it doesn't.
When the JVM does desperately need memory, it will run a Full GC and recover (almost)
all of that.
Then again it's nice to see someone who is curious about how the darn thing works.
:) Mike
"Chris" <[email protected]> wrote:
>
Thanks for the information. I guess I didn't understand it properly.
Is there a
reason why the numbers keep increasing, even with no site activity? It
looks like
there is less and less free space every few minutes....? After running
the whole
night after posting the original message, the numbers now look like:
[GC 55586K->42276K(130560K), 0.0136978 secs]
ie. Just keeps going up. Why does it increase? Thanks for any explanations!
Dimitri Rakitine <[email protected]> wrote:
You are not 'leaking memory' (hopefully!) - these are minor collections
(quickly
copying objects which lived long enough to the old generation portion
of the heap
and reclaiming space used by objects which died young) - wait until
major collection
(when it says [Full GC ...]).
Chris <[email protected]> wrote:
Help!
We are having strange problems that appear to be related to a memoryleak. The
strange part is that even if we don't hit the site, it appears to
leak.
Can someone
please explain the output below: Notice how freespace is decreasing,even with
no direct site activity:
[GC 48857K->35514K(130560K), 0.0136978 secs]
[GC 49018K->35548K(130560K), 0.0144821 secs]
[GC 49052K->35550K(130560K), 0.0128796 secs]
[GC 49054K->35549K(130560K), 0.0121789 secs]
[GC 49053K->35547K(130560K), 0.0126394 secs]
[GC 49051K->35582K(130560K), 0.0161642 secs]
[GC 49086K->35770K(130560K), 0.0209171 secs]
[GC 49247K->36005K(130560K), 0.0188181 secs]
[GC 49509K->36198K(130560K), 0.0129967 secs]
etc...
If I understand the numbers correctly, we have less and less free
space
available.
If anyone has any insights into this it will be greatly appreciated.We have problems
moving into production.
Our environment: Solaris 8, Jdk1.3.1, WL 5.1
Chris--
Dimitri -
"Hi,
I try and understand the mechanism of garbage collection of the Java Virtual Machine : Hewlett-Packard Hotspot release 1.3.1.01.
There is description of this mechanism in the pdf file : "memory management and garbage collection" available at the paragraph "Java performance tuning tutorial" at the page :
http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,1607,00.html
Regarding my question :
Below is an extract of the log file of garbage collections. This extract has 2 consecutive garbage collections.
(each begins with "<GC:").
<GC: 1 387875.630047 554 1258496 1 161087488 0 161087488 20119552 0 20119552
334758064 238778016 335544320
46294096 46294096 46399488 5.319209 >
<GC: 5 387926.615209 555 1258496 1 161087488 0 161087488 0 0 20119552
240036512 242217264 335544320
46317184 46317184 46399488 5.206192 >
There are 2 "full garbage collections", one of reason "1" and one of reason "5".
For the first one "Old generation After " =238778016
For the second "Old generation After " =238778016
Thus, "Old generation Before garbage collection" of the second is higher than "Old generation After garbage collection". Why?
I expected all objects to be allocated in the "Eden" space. And therefore I did not expect to sI agree but my current Hp support is not very good on JVM issues.
Rob Woollen <[email protected]> wrote:
You'd probably be better off asking this question to HP.
-- Rob
Martial wrote:
The object of this mail is the Hewlett-Packard 1.3.1.01 Hotspot JavaVirtual Machine
release and its garbage collection mechanism.
I am interested in the "-Xverbosegc" option for garbage collectionmonitoring.
I have been through the online document :
http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1_3/hotspot.html#-Xverbosegc
I would like to find out more about the garbage collection mechanismand need
further information to understand the result of the log file generatedwith the
"-Xverbosegc"
For example here is an extract of a garbage collection log file generatedwith
Hewlett-Packard Hotspot Java Virtual Machine. Release 1.3.1.01.
These are 2 consecutive rows of the files :
<GC: 5 385565.750251 543 48 1 161087488 0 161087488 0 0 20119552 264184480255179792
335544320 46118384 46118384 46137344 5.514721 >
<GC: 1 385876.530728 544 1258496 1 161087488 0 161087488 20119552 020119552 334969696
255530640 335544320 46121664 46106304 46137344 6.768760 >
We have 2 full garbage collections, one of Reason 5 and the next oneof Reason
1.
What happened between these 2 garbage collections as we got : "Oldgeneration
After" of row 2 is higher than "Old generation Before" of row 1? Iexpected Objects
to be initially allocated in eden and so we could not get "old generation2modified
between the end of one garbage collection and before the next one.
Could you please clarify this issue and/or give more information aboutgarbage
collection mechanisms with the Hewlett-Packard Hotspot Java VirtualMachine. Release
1.3.1.01. -
Im running a huge combinatorial generation algorithm and i'm starting to run into memory allocation errors on larger problem instances. I am using the -Xmx256m run time option on the JVM to give it more memory but im generating huge masses off stuff here.
The question I have is, if I know an object isnt going to be used again is it worth destroying it in memory yourself; i assume if you have some undesired object you can do something like this;
myObject = null;
and then call the garbage collector to free up the memory..firstly will this work, secondly what is there performance tradeoff for calling the garbage collector more often and lastly is the garbage collector allready efficient enough that doing things like this is probably not worth it.
Regards,
DaveSetting references to null MAY help get immediate relief, but its not guarunteed to help. Same with the System.gc() call.
Doing both those thing will not enable the system to operate with less memory than before, as variables that are out of scope will be discovered during garbage collection, and garbage collection WILL run when the heap is fully utilized.
Doing the above may make the GC pause lower at the expense of worse performance.
Instead of doing the above, I'd recommand using the Incremental GC by specifying -Xincgc on the command line. This will run GC more often in the background, leading to shorter GC pauses, but about 10% performance hit in general.
If OTOH you are running into OutOfMemoryErrors and don't think you should be, you probably have a memory leak. Most likely you are allocating objects and storing them somewhere then forgetting about them. For example, if you stick an object in a HashMap, and then forget about it, that object will not be GC'd, unless the HashMap can be GC'd. -
Long pauses during ParNew garbage collection Please Help !
Hi,
We are running a server application on an large machine (~120 CPU, ~380 GB Memory).
After running 1 or 2 hours we suddenly get exorbitant application pause times during garbage collection and a massive cpu usage from the java vm
We are running on Java 6 (64Bit) with 6GB Heap.
Concurrent garbage collection is turned on using the parameters:
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:CMSInitiatingOccupancyFraction=80
-XX:+DisableExplicitGC
We turned on verbose garbage collection and are getting the following output:
1. Normal operation:
Application time: 217.4656792 seconds
3180.905: [GC 3180.906: [ParNew
Desired survivor size 20119552 bytes, new threshold 4 (max 4)
- age 1: 2843824 bytes, 2843824 total
- age 2: 2577128 bytes, 5420952 total
- age 3: 5742024 bytes, 11162976 total
- age 4: 625672 bytes, 11788648 total
: 329531K->15764K(353920K), 0.1484379 secs] 2435799K->2122105K(3392144K), 0.1492386 secs]
Total time for which application threads were stopped: 0.1886810 seconds
2. The Problem:
Application time: 2.8858445 seconds
5008.433: [GC 5008.434: [ParNew
Desired survivor size 20119552 bytes, new threshold 2 (max 4)
- age 1: 15837712 bytes, 15837712 total
- age 2: 12284416 bytes, 28122128 total
: 348338K->39296K(353920K), 138.5317715 secs] 2487779K->2192551K(3392144K), 138.5327383 secs]
Total time for which application threads were stopped: 138.5778558 seconds
Application time: 2.9764564 seconds
5149.957: [GC 5149.957: [ParNew
Desired survivor size 20119552 bytes, new threshold 2 (max 4)
- age 1: 9483176 bytes, 9483176 total
- age 2: 14499344 bytes, 23982520 total
: 353920K->39296K(353920K), 231.5110574 secs] 2507175K->2204546K(3392144K), 231.5121011 secs]
Total time for which application threads were stopped: 231.5257754 seconds
Application time: 2.7932907 seconds
5384.277: [GC 5384.278: [ParNew
Desired survivor size 20119552 bytes, new threshold 4 (max 4)
- age 1: 10756376 bytes, 10756376 total
- age 2: 9135888 bytes, 19892264 total
: 353920K->28449K(353920K), 256.2065591 secs] 2519170K->2207651K(3392144K), 256.2076388 secs]
Total time for which application threads were stopped: 256.2221463 seconds
I can't find any significant differences in the log between fast and long running garbage collections.
I urgently need help in solving this problem !
What can I do ?After the exciting reply I did get on my question, we did some more investigations on the problem and it seems that we finally found the solution to our problem.
The number of garbage collection threads used by the virtual machine defaults to the number of cpus of the machine.
This is ok for small machines or machines where the main load is produced by the java application itself.
In our environment the main load is not produced by the java application but oracle database processes.
When java tries to do it's garbage collection using 120 threads (# CPU) on the machine which is already overloaded by non java processes, the thread synchronization seems to produce an exorbitant overhead.
My theory is that spin locking is used on memory access, causing threads to spin while waiting for other blocking threads not getting cpu because of the heavy load on the system.
The solution is now to limit the number of garbage collection threads.
We did that on the first try by setting -XX:ParallelGCThreads=8
For over one day with heavy load no long GC pauses were experienced any more. -
Animation gets slow when program needs a Garbage Collect.
So nonetheless, I should probably develop a new animation algorithm, yes?
I am looping through a seperate thread that calls the setSize() methods a bunch of times. Works really nice when memory isnt bad, but when I need to garbage collect, and apparantly java doesnt agree, it gets really slow. Later one is really able to see when a GC is actually done, and it goes back to normal.
Here is my algorithm,
public static boolean raisePanel(final VCMSComponentFrame p, final boolean anim)
if (p.getState() == VCMSComponentFrame.State.RAISED ||
p.getState() == VCMSComponentFrame.State.ANIMATING)
return false;
new Thread(new Runnable()
public void run()
p.setState(VCMSComponentFrame.State.ANIMATING);
if (anim)
for (int i = p.getHeight(); i <= FULL_PANEL_HEIGHT; i++)
try
p.setSize(p.getWidth(), i);
JComponent parent = (JComponent)p.getParent();
int index = findIndex(p);
for (int j = index + 1; j < parent.getComponentCount() && j != 0; j++)
parent.getComponent(j).setLocation(parent.getComponent(j).getX(), parent.getComponent(j).getY() + 1);
//Viewport Panel
parent.setSize(parent.getWidth(), parent.getHeight() + 1);
//Structure Frame
VCMSStructurePanel panel = (VCMSStructurePanel)parent.getParent();
parent.getParent().setSize(panel.getWidth(), panel.getHeight() + 1);
//Structure Siblings.
JPanel master = (JPanel)panel.getParent();
index = findStructureIndex(panel);
for (int j = index + 1; j < master.getComponentCount() && j != 0; j++)
master.getComponent(j).setLocation(master.getComponent(j).getX(), master.getComponent(j).getY() + 1);
Thread.sleep(1);
catch (Exception ex)
else
p.setSize(p.getWidth(), FULL_PANEL_HEIGHT);
JPanel parent = (JPanel)p.getParent();
int index = findIndex(p);
//Viewport Panel
parent.setSize(parent.getWidth(), parent.getHeight() + FULL_PANEL_HEIGHT - SHORT_PANEL_HEIGHT);
//Structure Frame
VCMSStructurePanel panel = (VCMSStructurePanel)parent.getParent();
parent.getParent().setSize(panel.getWidth(), panel.getHeight() + FULL_PANEL_HEIGHT - SHORT_PANEL_HEIGHT);
//Component Siblings
for (int j = index + 1; j < parent.getComponentCount() && j != 0; j++)
parent.getComponent(j).setLocation((int)parent.getComponents()[j].getLocation().getX(), (int)parent.getComponents()[j].getLocation().getY() + FULL_PANEL_HEIGHT - SHORT_PANEL_HEIGHT);
//Structure Grandparent
JPanel master = (JPanel)panel.getParent();
index = findStructureIndex(panel);
for (int j = index + 1; j < master.getComponentCount() && j != 0; j++)
master.getComponent(j).setLocation((int)master.getComponent(j).getLocation().getX(), (int)master.getComponent(j).getLocation().getY() + FULL_PANEL_HEIGHT - SHORT_PANEL_HEIGHT);
p.setState(VCMSComponentFrame.State.RAISED);
}).start();
//System.gc();
return true;
}any help appreciated!sierratech wrote:
Only a guess, but this may have something to do with Threads and Swing.
http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html.
Many Swing updates should be called in the Event Dispatch thread, and it looks like you may be calling some of these in your new Thread.
Try using SwingUtilities.invokeLater() and see if that helps. Alternatively, rewrite your code to remove the Thread and do everything in the event Dispatch thread using javax.swing.Timer. Again, just a guessThanks for the Idea, but this option doesnt even show the animation.
One Idea I got from a "Swing Hacks" directory works like this:
Remove the components for animation.
Create an image of the components.
Overide the Paint method.
Animate the images via paint method.
Remove the images.
Add back the components.
But I look at that and my stomach cringes.
Any other Ideas? -
I have a number of forms that use functionality encapsulated in script variables. These script variables have state in them, that must survive between calls. However, SpiderMonkey's GC disagrees, causing issues when objects that are supposed to be initialized disappears. I know there are some workarounds for this, but I worry that none of them are documented by Adobe. Many of these forms are used by third parties and must continue to work from year to year and version to version of Reader. Does anyone have suggestions?
personal opinion really. I do call garbage collection destruction, the memory occupied by the objects in question is reclaimed. It is a discussion point however as it is from the perspective of the JVM; from the perspective of the application the object is "destroyed" as soon as you cut all references to it.
What to explain about finalize()? It is invoked right before an object is garbage collected, possibly allowing you to do some last minute clean up jobs, like letting go of resource handles and such. The general rule about it is that in 99.99% of the cases you need not touch it. If you have a design where you need it, it is best to assume the design is wrong and you need to change it. For example in the case of closing resources, it is better to have a close() method that needs to be invoked manually.
If you do use it, you better be really sure that you know what you are doing as you may cause performance problems or even hard to trace unexpected behavior.
Maybe you are looking for
-
View creation on MKPF and MBEW
Hi gurus, I want to create a view on mkpf and mbew data base table for creating the generic extractor. Can one please tell me the step by step procedure or any screen shots send to mail id, my id is [email protected] i will be grateful if any help is
-
Internal links disapear when I publish
When I publish my site, the internal links that usually appear on the top of each page are not there. They are there in iweb, but not when the page is accessed from a browser. Here is the link to the homepage in question so what I am describing can b
-
Looking for tiling + Gnome
I've been looking for an easy to use tiling window manager to use with Gnome. One that doesn't require a lot of configuration. In the past, I have used KDE primarily and really liked the idea of kwin tiling. In fact, kwin tiling is pretty much exactl
-
Hello, I'm trying to create an applet that will have a dot (any color) appear when the mouse is clicked. Most places have examples of buttons, but I am having a tough time figuring this one out. Thanks, -Rain
-
Menu bar accessibility severe issue
Dear support team I am a visually impair person (20/100) vision. I am working as software architect since 27 years in the Windows and Linux world. A year ago I bought an AirPort and I fall in love with Apple product best quality: "Always work like a