In java(1.6 or earlier) , are there any type of objects that are not subject to garbage collection?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
All java objects are subject to garbage collection. However native resources are not directly managed by the garbage collector, some like window handles (JFrame) are freed by the garbage collector when a finalize() method is implemented others need manual resource management.
Also the jvm does not have to collect existing objects before it shuts down, this can cause subtle bugs like data not being flushed to disk.
Last there are extensions to the java spec for real time systems or smart cards which include unmanaged memory for performance and resource reasons. However this does not apply to the standard jvm.