Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
Search the Tips
Tip Bank > Java > Garbage Collection

Garbage Collection

19 of 19     Previous     Next
Raising Notifications from RMI
by Leonard Anghel
Ever wish you could have your RMI application notify you when it's using the distributed garbage collector? This tip will show you how.
Monitoring Garbage Collection in the JVM
by Amit Tuli
Though Java manages the memory allocation and de-allocation for these objects, sometimes this huge number can result in memory leak problem. This tip shows you a way to manage garbage collection in the JVM.
Closing JDBC Objects Explicitly Can Save You Headaches!
by Keith Naas
If you're closint database connections directly—without closing the ResultSet or Statement, you've been causing yourself unnecessary trouble.
Setting the Default Memory Limit of the JVM
by Nitin Garg
To set the memory limits of the JVM in a Java application, run the program using following ...
Allocating Memory Before Calling a Function
by Shantanu Garg
Suppose you want to pass an object to a method and also want to allocate the object into that method. If you pass the object as it is, it will not work because the memory that the object points ...
Making Better Use of Garbage Collector
by Jose Antonio
Imagine you have an enormous object serialized on disk that you ...
Destroying Objects
by DevX Pro
In VB, you can release the object's memory with the following: set object = nothing How do you accomplish the same thing in Java?
Object Finalization
by DevX Pro
How can I finalize an object without waiting for the garbage collector?
Lazy Versus Eager Instantiation
by Behrouz Fallahi
There are techniques for creation of objects (read allocation of ...
Destructors
by DevX Pro
In Java, how do I achieve the same functionality which is provided by class destructors in C++? Is there a destructor method in Java?
Determining Memory Usage
by DevX Pro
Is there a way to determine the percentage of CPU usage or RAM usage within a Java application?
Setting Heap Sizes
by Brett Spell
If your Java program requires a large amount of memory, it's possible that the virtual machine will begin to throw OutOfMemoryError instances when attempting to instantiate objects. In some cases, ...
Efficient Use of the Vector Class
by Ajit Sagar
The Vector class in java.util is one of the most frequently used classes in Java development. It almost makes the problem of memory management non-existent, unlike a fixed-size array. However, using ...
Putting out the Trash Using the gc() Call
by Ajit Sagar
The gc() call on the Java Virtual Machine's garbage collector is often misunderstood. One of the reasons Java is such an easy language to program in is that it takes the burden of memory management ...
Finalization and Cleanup
by Richard G.
Although Java does not provide a destructor as in C++, you can use an overridden finalize() method for similar purposes. The overridden finalize() method is invoked on an object before the garbage ...
Garbage collection process
by DevX Pro
If i have a code like this in the while loop while (true){ java.util.date ldt_date = new java.util.Date() ... } Will the ldt_date variable be initialized with new location in memory all the time and previously allocated will be garbage collected by java. I am not sure about what's happening in here. Could you explain me more about the behaviour of this statement.
Helping the Java Garbage Collector
by Randy Kahle
When you create an object in Java, such as in the following ...
Threads
by DevX Pro
I recently took Sun's Certified Java Programmers Exam and I ran into a few questions from the exam I'd like to ask you. What is the difference between >> and >>>? For example let's say you have: int x = 64; what is x >> 4? what is x >>> 4? I get 4 for both. What can be said about garbage collection? Select all true statements: a. It will be done so that your program will never run out of memory (within reason). b.It happens at predictable times. c.You can flag an object for collection. d.You can call a method to have an object explicitly collected. Under which circumstance would a thread stop execution? Select all true statements: a.A thread with a higher priority becomes run-able. b.The priority of the running thread is changed. c.Thread objects of the same class terminates. If you have an object and then you set it to null: SomeObject ob = new SomeObject(); ob = null; after you set ob to null, is the object available for garbage collection?
What happens to dangling pointers in java?
by DevX Pro
What happens to dangling pointers in Java? Supposedly there is garbage collection, but when is it performed? From what I have read, it seems really easy to have persistent dangling pointers (pointers to objects that no one is using that aren't being cleaned up by garbage collection). Let's say I have a collection of objects, and one of the functions that manipulates the collection is called removeObject(int i), which removes the ith object from the collection and returns a pointer to the removed object. Sometimes I need to get the removed object to salvage it for reuse; other times I simply want to remove the object. Is the returned pointer left dangling if I don't assign it when I make the function call? Should it be left to the function-caller to dispose of unused objects, or should the programmer make two functions, deleteObject() and removeObject()?
19 of 19     Previous     Next
Sitemap