Solved

Object Deallocation

Posted on 2004-08-16
7
294 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
String format issue 13 91
bean mapper frameworks 5 60
AlarmClock Challenge 35 150
Is possible to make a jsp script work with oracle wallet? 7 101
One of the biggest threats facing all high-value targets are APT's.  These threats include sophisticated tactics that "often starts with mapping human organization and collecting intelligence on employees, who are nowadays a weaker link than network…
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now