Results 1 to 1 of 1
Thread: jfileChooser - memory question
- 05-13-2011, 01:44 AM #1
Member
- Join Date
- May 2011
- Posts
- 1
- Rep Power
- 0
jfileChooser - memory question
Hi ,
This is my first post in this forum ... so, Hi to all of you!
I am having a memory consumption just making click to open a filechooser.
The application starts with about 45 mb but after 50 clicks on the filechooser buttom the appication reaches about 95 MB .
The OK buttom is never pressed ...so part of the code won't run.
As you can see i am using "null" for the object at the end of the code. So ..I suppose the garbage collector will clear the instances.
Then my question ....Why after a couple of minutes the application never decreases the memory usage ? Why the GC does nothing ? Even doing object = null
I know that each time I do click I am creating a new instance of the file chooser...thats is true but ....but is guess the GC has to do his job.
Please, can some one take a look to the next code ?
Maybe i am doing something horrible LoL
Thank you in advance!
Regadrs,
Nicolas
Java Code:JFileChooser fc=null; fc = new JFileChooser(sDefaultPathChooserSave); int iRowSelected = jTable1.getSelectedRow(); String filePathDicomImage = (String) model.getValueAt(iRowSelected, 1); File file = new File(sDefaultPathChooserSave); if (System.getProperty("os.name").toLowerCase().compareTo("linux")==0) { fc.setCurrentDirectory(file); fc.setSelectedFile(file); } else { fc.setSelectedFile(file); fc.setCurrentDirectory(file); } fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); int value = fc.showSaveDialog(fc); if (value == fc.APPROVE_OPTION) { file = fc.getSelectedFile(); sDefaultPathChooserSave = fc.getSelectedFile().toString(); ThreadWorker oThread = new ThreadWorker(filePathDicomImage,file.getAbsolutePath()); Thread Threadconverter = new Thread(oThread); Threadconverter.start(); file = null; } fc=null; }
Similar Threads
-
JFileChooser
By javabarn in forum New To JavaReplies: 2Last Post: 07-12-2010, 06:08 PM -
question about so-called "memory consistency errors"
By gib65 in forum Threads and SynchronizationReplies: 2Last Post: 06-20-2010, 04:20 PM -
Jfilechooser
By greatmajestics in forum Java 2DReplies: 5Last Post: 03-30-2010, 06:13 PM -
how do I increase memory allocated to code cache (Non Heap Memory)
By manibhat in forum Advanced JavaReplies: 2Last Post: 08-21-2008, 07:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks