In Java, how is an Array of objects garbage collected? -


when array of objects not referenced anymore, objects in array garbage collected too? (assuming no variables referencing elements)

in page, http://java.sys-con.com/node/37613 says - "the biggest danger placing object collection , forgetting remove it. memory used object never reclaimed."

if make sure nullify references, why memory unclaimed?

thanks

when array of objects not referenced anymore, objects in array garbage collected too? (assuming no variables referencing elements)

yes.

"the biggest danger placing object collection , forgetting remove it. memory used object never reclaimed."

this when are holding reference collection. example, if have map in put key-value , forget remove stays there ever. think http sessions, if use in servercontext or such @ start of request using session id key fail remove @ end of request processing..


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -