Sitemap

Amicuk Programming Answers

Do you think JOptionPane dialogs force garbage collection afterwards?

2015-10-11   Views:0

Advertisement

I ask because I've made a nested static class to implement my own file selection tool; the problem is that each time I call it the old JPanel is being recalled and so the components get re-added to it each time it's called, resulting in n versions of

I ask because I've made a nested static class to implement my own file selection tool; the problem is that each time I call it the old JPanel is being recalled and so the components get re-added to it each time it's called, resulting in n versions of each file for every n times you open it.
I'm running myDialog.dispose() upon exiting, so is my only option now manual garbage collection? How could I force it to be garbage collected? Because System.gc() seems to have no effect.

The replay answer
Advertisement
Strictly speaking there is no way to force garbage collection, so, no, JOptionPane will not be doing it.
You almost certainly have a leak in your code. Post it and we may be able to help.

Go to See the other 3 answers

Do you think JOptionPane dialogs force garbage collection afterwards?

Category:DefaultRelease time:2015-10-11Views:130

I ask because I've made a nested static class to implement my own file selection tool; the problem is that each time I call it the old JPanel is being recalled and so the components get re-added to it each time it's called, resulting in n versions of[More]

Memory leak in java / forcing garbage collection for unused resource?

Category:DefaultRelease time:-0001-11-30Views:130

Is there any possibility in big programs if not designed properly for leakage of memory? If say i forget to force garbage collection of unused resouces what will happen? Even if i am forcing garbage collection how much assurity can be given to do so?[More]

Force Garbage Collection through scripting

Category:DefaultRelease time:-0001-11-30Views:130

Hi , I am using weblogic server 8.1.5 on windows 2003 server. can we do force garbage collection through a script? If so can i have a sample script for the same? OS:windows 2003 server thanks in advance. Madan MohanAnd the key here is "any length of[More]

Why can we force Garbage Collection

Category:DefaultRelease time:-0001-11-30Views:130

Hello, Why can we force garbage collection since we have AUTOMATIC garbage collection?If you don't call dispose on the Window, it may keep a GUI thread running in the background. Since this thread is still running and accesible from the root, it will[More]

Force Garbage Collection

Category:DefaultRelease time:-0001-11-30Views:130

Before I load a new level, should I force garbage collection on the old level? And if so, how?Just remember that the method suggest the garbage collector to run, not forcing it.. If you have a lot of objects created that are later available for garba[More]

Force Garbage collection externally....

Category:DefaultRelease time:-0001-11-30Views:130

hi! I am new to java.is it possible to the force Garbage collection externally? can i achieve it by giving the command "System.gc();".pls give me idea... Thanx Rgds,You can't force a full GC as far as I know. gc() might force a GC of the younges[More]

Applescript: force garbage collection?

Category:DefaultRelease time:-0001-11-30Views:130

Hello I am trying to call applescript functions (from my cocoa application - using NSAppleScript's -executeAndReturnError), to automate some operations in Microsoft Word. The problem is that after every Applescript call, the Word operates slower and[More]

Howto Force Garbage Collection manually in Oracle Application Server

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I have a Oracle SOA suite installed on Oracle 10g Application Server. The heap memory for the SOA oc4j container is 2G with a permgen space of 256M. But it looks like there is some memory leak somewhere and the Heap area is getting filled frequen[More]

Will system.gc() force garbage collection?

Category:DefaultRelease time:-0001-11-30Views:130

what impact will the method system.gc() have if i call it in one of the user methods.If you use Sun's HotSpot 1.5.0 JVM (or later) with the -XX:+UseConcurrentMarkSweepGC (low-latency) garbage collector, you can use the additional flag -XX:+ExplicitGC[More]

Can I force full garbage collection?

Category:DefaultRelease time:-0001-11-30Views:130

Hi, my program is memory bound , as users load more files more memory is required , if the user decides to load a very large number of files they will eventually run out of memory. So I am trying to detect when there is less 15% of heap memory left,[More]

Cache voluntary garbage collection called

Category:DefaultRelease time:-0001-11-30Views:130

We have installed Oracle Web Cache 2.0.0.4.0 on Windows 2000. We setup the Maximum cache size parameter to 1000Mb, but, when we try to caching a web using WGET, Oracle Web Cache return a "cache voluntary garbage collection called" in the file of[More]

Hot
Greetings all, I'm a recent convert from the world of Windows to Mac and I've enjoyed it more than you can imagine. I'm a network admin at a major airport and have come to hate working on Windows during the day to working on Windows at home. Although [More]
Hello, I keep getting the below error in the log file when the process is complete, does any one has this error before?  The error does not affect the process but it is kind of annoying when looking at the log file.  I try to use the other component [More]
Hi, I want to design a crystal report with a barchart. I should specify the color of the bar based on some conditions, this colornames are maintained in the database. I tried using chart expert -> color highlights, is there any other way to set the c [More]
If I'm reading the manuals and the pro training books right, the only way to export chapter markers from FCP 5 is to a QT movie. That kinda stinks a little. Would a workaround be to export to QT and then run compressor as stand-alone? Seems like an e [More]
Goodday all, At the moment I'm working on a little class that reads the input from the console screen. The class looks like this (I omitted a few unrelevant methods): public class SomeClass {   private static BufferedReader bin = null;   // private c [More]
After updating to 29 when I would check my plug-in status it would either not recognize a plug-in was outdated, or when it did, the update now button would redirect to the plug-in page I was on already. I have been going directly to the sites to upda [More]
My lock screen picture is zoomed in. When I try to change it, I can't scale it, or try to zoom out to a position I like. It is permanently stuck in one position. I asked a friend that had ios7 and he can't relate, and has never seen it before. Any he [More]
this link from the wiki says i should edit my /etc/fstab in order to enable trim on my ssd. this is my /etc/fstab # /etc/fstab: static file system information # <file system> <dir> <type> <options> <dump> <pass> # UUID= [More]
Hi everyone, I'm having trouble with converting a drum audio track (eg, kick drum) to midi. I tried doing this by highlighting the track and then clicking on "convert regions to sampler track". I have read about this in the manual and have watch [More]
Frames keep on droppin' and FCE keeps telling me to lower the compression rate (among other things I've already taken care of, so I'm guessing this is the problem). But 1) I have no idea where to do this and 2) I have no idea what to change the rate [More]