Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #599
| From | "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: memory allocation for |
| Message-ID | <1168280728.343905.326060@v33g2000cwv.googlegroups.com> (permalink) |
| Newsgroups | comp.lang.java.gui |
| References | <45a1dc0d$0$11216$4c368faf@roadrunner.com> |
| Date | 2011-04-27 15:28 +0000 |
| Organization | TDS.net |
To: comp.lang.java.gui Brandon McCombs wrote: > hello, > > My application makes multiple JNDI search calls to a directory server. > The search method returns a NamingEnumeration of SearchResults and I run > through a while loop that converts the enumeration to a Vector of > SearchResults. At another time I process the Vector to add the > SearchResults to a ListModel for viewing their properties. > > My application takes up a lot of memory after running that search > operation a handful of times. It seems that the majority of the memory > allocation comes from the hasMoreElements() method of the enumeration > that I call within the while() mentioned above. I don't see any way of > not calling that method since I need it to grab the search results. The > question I have is why would the JVM use so much space for that method > and is there anything I can do to reclaim the memory? JProfiler says > that after a handful of search() executions there are over a million > allocations of hasMoreElements() that take up 50 megs. Jprofiler shows > garbage collections are occurring but since a method and not an Object > is taking up the memory I don't know how to fix this problem. > > As a side note, if it was possible to properly cancel JNDI search > methods (from the InitialLdapContext class) then I wouldn't have such a > problem but once those searches start they can't be canceled from what I > can gather, despite utilizing threads. > > thanks > Brandon Method calls don't explicitly allocate memory. I think you're misinterpretting your profiler report. Also, why not use ArrayList instead of Vector? Vector is outdated. Other then that, I don't have any advice to give you, sorry. --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar
memory allocation for a m "Brandon McCombs" <brandon.mccombs@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
Re: memory allocation for "Daniel Pitts" <daniel.pitts@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
Re: memory allocation for "Brandon McCombs" <brandon.mccombs@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
Re: memory allocation for "Brandon McCombs" <brandon.mccombs@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
Re: memory allocation for "Nigel Wade" <nigel.wade@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
Re: memory allocation for "Brandon McCombs" <brandon.mccombs@THRWHITE.remove-dii-this> - 2011-04-27 15:28 +0000
csiph-web