Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Object Deallocation

Posted on 2004-08-16
7
295 Views
Last Modified: 2010-08-05
HSSFWorkbook hsswb = new HSSFWorkbook();
    HSSFSheet sheet = hsswb.createSheet("Abstract collection report");


If i declare this type of object in JSP and do not deallocate them
what will be the effect..

Is it necessary to do it..
0
Comment
Question by:Ritug
  • 5
7 Comments
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11808668
You do not need to do that. Garbage collector will help you maintain unused instance of object.
It will cleanup automatically if there is no reference to that object.
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11808702
In more detail about garbage collection.

Garbage collection is an mechanism that java virtual machine use for maintaining memory. The object that is not used anymore which JVM detect by check whether there is any reference to it or not. If not the container will decide to garbage that object from memory. We will not know when container(JVM) will decide to do that. Container start to do it by themselve.

Here is an example

String a="abc";  // this will create instance of string "abc" in memory and point or reference by variable a
a=null; // set a reference to null so "abc" instance can not refer to anymore
//container will clean "abc" later....


Regards,

0
 

Author Comment

by:Ritug
ID: 11809065
Thanks for assistance
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 11809075
Best of luck. :)
0
 
LVL 1

Expert Comment

by:umangjoshi
ID: 11809752
set it to null, rest will be handle by garbage collector.
0
 
LVL 11

Accepted Solution

by:
sompol_kiatkamolchai earned 500 total points
ID: 11810394
Please accept my answer if you feel your problem is over. :)
0
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 12003814
Thanks mate.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
The business world is becoming increasingly integrated with tech. It’s not just for a select few anymore — but what about if you have a small business? It may be easier than you think to integrate technology into your small business, and it’s likely…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question