garbage collector

garbage collector

Hi

what is the adventage using system.gc() method ?

what is the adventage f annotation in java ?

how can we loads the spring context file ?

what is advantage of spring framework?

what is the bean definatin in spring?

what is earger loading and lazy loading in hibernate ?

View Answers

September 10, 2012 at 1:45 PM

Advantage of system.gc():

System.gc() runs the Garbage Collector.The JVM performs this recycling of all discarded obj's even if gc is not invoked explicitly.System.gc() is a static method so it is more convenient to use.

Advantages of Annotations:

1)It has made Enterprise Application Development easy.

2)Annotations are generally used to embed in a program data that would otherwise be furnished in a side file. With annotations, you put the specification information right in your code next to the program element that it affects. This is a more intuitive and convenient approach.

3)Annotations typically contain several optional elements to allow detailed customization of an application.

4)One immediate benefit of annotations for web services is that many formerly required markers, such as the extends java.rmi.Remote and throws java.rmi.RemoteException that were borrowed from remote method invocation (RMI), are no longer necessary.

Java EE 5 platform provides annotations for the following tasks:
Defining and using web services
Developing EJB software applications
Mapping Java technology classes to XML
Mapping Java technology classes to databases
Mapping methods to operations
Specifying external dependencies
Specifying deployment information, including security attributes.

Advantage of Spring Framework:

1)Spring is Lightweight container.
2)No App Server Dependent ? like EJB JNDI Calls.
3)Objects are created Lazily , Singleton - configuration
4)Components can added Declaratively.
5)Initialization of properties is easy ? no need to read from properties file.
6)Declarative transaction, security and logging service - AOP
7)application code is much easier to unit test.
8)With a Dependency Injection approach, dependencies are explicit, and evident in constructor or JavaBean properties.
9)Spring's configuration management services can be used in any architectural layer, in whatever runtime environment.
10)Spring can effectively organize your middle tier objects.
11)Not required special deployment steps.

Eager and Lazy loading:

lazy loading means that any foreign key references that you have in you table will be loaded only when referred to by the application. Eager loading means everything will be loaded at once.

Hibernate adopts the mechanism of lazy loading to load objects from databases. Lazy loading contributes a lot to improve the performance of an application by limiting the amount of objects that will be needed.

Eager loading loads the full objects tree once. Because eager loads multiple related objects with a single SELECT statement instead of using multiple SELECT statements, therefore in some situations, eager loads can also improve the performance of the application by reducing the times of accessing the database.









Related Tutorials/Questions & Answers:
Garbage Collector
Garbage Collector  Hi, Can any one please tell me what are the types of garbage collector ?? Regards: Akash
GARBAGE COLLECTOR
GARBAGE COLLECTOR  What is garbage collector in java?   In order to achieve run-time polymorphism in java following supports needed. At first overrides the super-class one or more methods in subclass this is due
Advertisements
Java garbage collector
Java garbage collector  What is the priority of Garbage collector thread
garbage collector
garbage collector  Hi what is the adventage using system.gc() method ? what is the adventage f annotation in java ? how can we loads the spring...;Advantage of system.gc(): System.gc() runs the Garbage Collector.The JVM
WHAT IS GARBAGE COLLECTOR AND HOW IT IS USED
WHAT IS GARBAGE COLLECTOR AND HOW IT IS USED  WHAT IS GARBAGE COLLECTOR AND HOW IT IS USED   The garbage collector collects garbage. When you create object they produce garbage, and the garbage collector gets rid
Java Garbage collector
Java Garbage collector  What kind of thread is the Garbage collector thread?  Hi Friend, It is a daemon thread. Thanks
Java garbage collector
Java garbage collector  Does garbage collection guarantee that a program will not run out of memory?  Hi, The Java Garbage Collector does not guarantee of this. Thanks
Garbage collector thread - Java Beginners
Garbage collector thread  Hi, Please let me know what kind of thread is the Garbage collector thread? Thanks  Hi Friend, It is a daemon thread. Thanks
Java garbage collector
Java garbage collector  How you can force the garbage collection
Java garbage collector
Java garbage collector  Which is garbage collected first: Normal variables or static variables
garbage collector - Java Interview Questions
garbage collector  what is the use of garbage collector?  Hi friend, import java.util.Vector; public class GarbageDemo{ public...; for (int i = 0; i < size; i++) { } System.out.println("Garbage
garbage collector - Java Interview Questions
How Garbage Collector Works   how does Garbage Collection works?  Garbage Collection in JavaGarbage Collector Garbage collection"... unreferenced objects on the fly. if you want more details about Garbage Collector
Garbage Collector - Java Interview Questions
Garbage Collector  Why Database Connection object is not Garbage Collected? As we need to close the connetion manually, not like with other objects garbage collected
Garbage Collection
; In the example we are describing how the garbage collector works..., first we are creating three objects to give the garbage collector something... the last one to determine the time taken by the garbage collector to complete
Code for Garbage Collection
to force a garbage collector to work by creating many objects. Description... collection. First of all we have created an object for the garbage collector... Code for Garbage Collection  
Java garbage collection
Java garbage collection  How many times may an object's finalize() method be invoked by the garbage collector
garbage collection - Java Beginners
then it will be automatically deleted by the garbage collector. It save the some amount..."algorithms.Instead of "destructor" in c++ , java supports garbage collector...garbage collection  wat is the use of garbage collection  
garbage collection in java
_TO_REPLACE_2 In this section, you will learn how to force a garbage collector... for the garbage collector to perform some operation. Then we have used the System.gc... .style1 { color: #FFFFFF; } Garbage Collection in Java In java
Garbage collection process in java - Java Beginners
In Java the Garbage collection process is known as Garbage Collector. The Garbage.... Program can call the System.gc() method to call the Garbage Collector...Garbage collection process in java  Name the process used for Garbage
garbage collection
garbage collection  how to use garbage collection in program using core java
What is garbage collection? - Java Beginners
. The Garbage collector is responsible for running the Garbage collection process.... But Garbage collector will finally decide weather to call Garbage collection...What is garbage collection?   Hi, Tell me about garbage collection
Garbage collection
Garbage collection  why garbage collection? How it works?   Garbage collection is one of the most important features of Java. The purpose of garbage collection is to identify and discard objects that are no longer
Java garbage collection
Java garbage collection  What is Garbage Collection and how to call it explicitly
Java Garbage Collection
. The garbage collector determines which objects are no longer referenced... Java Garbage Collection      ... on garbage collection. The name "garbage collection" implies
Java garbage collection
Java garbage collection  Can an object be garbage collected while it is still reachable
c++ garbage collection implementation
c++ garbage collection implementation  How to implement the garbage collection program in C
ModuleNotFoundError: No module named 'garbage'
ModuleNotFoundError: No module named 'garbage'  Hi, My Python... 'garbage' How to remove the ModuleNotFoundError: No module named 'garbage... to install padas library. You can install garbage python with following command
Java garbage collection
Java garbage collection  Can an unreachable object become reachable again
ModuleNotFoundError: No module named 'the-collector'
ModuleNotFoundError: No module named 'the-collector'  Hi, My... 'the-collector' How to remove the ModuleNotFoundError: No module named 'the-collector' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'Collector'
ModuleNotFoundError: No module named 'Collector'  Hi, My Python... 'Collector' How to remove the ModuleNotFoundError: No module named 'Collector' error? Thanks   Hi, In your python environment you
garbage collection implementation dependent java
garbage collection implementation dependent java  How a garbage collection works in Java
Getting garbage value
Getting garbage value  Thanks for the reply. Its works well, but whenever I'm using numeric value from 0010 to 0757 it is returning some garbage value. I dont have the idea what is going wrong. Please give me some idea to solve
php garbage collection sessions - PHP
php garbage collection sessions  i wanted to know more about the php garbage collection sessions.. how can i create and hold
ModuleNotFoundError: No module named 'garbage-translator'
ModuleNotFoundError: No module named 'garbage-translator'  Hi, My... named 'garbage-translator' How to remove the ModuleNotFoundError: No module named 'garbage-translator' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'garbage-translator'
ModuleNotFoundError: No module named 'garbage-translator'  Hi, My... named 'garbage-translator' How to remove the ModuleNotFoundError: No module named 'garbage-translator' error? Thanks   Hi, In your
Getting garbage value
Getting garbage value  Thank You Sir for helping me out from the problem. Now I'm facing some problem with the value I'm passing to the textfield from the link gets some garbage value whenever I'm using some particular set
Getting garbage value
Getting garbage value  Thank You Sir for helping me out from the problem. Now I'm facing some problem with the value I'm passing to the textfield from the link gets some garbage value whenever I'm using some particular set
ModuleNotFoundError: No module named 'arxiv-collector'
ModuleNotFoundError: No module named 'arxiv-collector'  Hi, My... named 'arxiv-collector' How to remove the ModuleNotFoundError: No module named 'arxiv-collector' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'broadview-collector'
ModuleNotFoundError: No module named 'broadview-collector'  Hi, My... named 'broadview-collector' How to remove the ModuleNotFoundError: No module named 'broadview-collector' error? Thanks   Hi
ModuleNotFoundError: No module named 'cpu-collector'
ModuleNotFoundError: No module named 'cpu-collector'  Hi, My... 'cpu-collector' How to remove the ModuleNotFoundError: No module named 'cpu-collector' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'gl-collector'
ModuleNotFoundError: No module named 'gl-collector'  Hi, My Python... 'gl-collector' How to remove the ModuleNotFoundError: No module named 'gl-collector' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'logagg-collector'
ModuleNotFoundError: No module named 'logagg-collector'  Hi, My... named 'logagg-collector' How to remove the ModuleNotFoundError: No module named 'logagg-collector' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'metrics-collector'
ModuleNotFoundError: No module named 'metrics-collector'  Hi, My... named 'metrics-collector' How to remove the ModuleNotFoundError: No module named 'metrics-collector' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'news-collector'
ModuleNotFoundError: No module named 'news-collector'  Hi, My... named 'news-collector' How to remove the ModuleNotFoundError: No module named 'news-collector' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'performanceplatform-collector'
ModuleNotFoundError: No module named 'performanceplatform-collector'  ...: No module named 'performanceplatform-collector' How to remove the ModuleNotFoundError: No module named 'performanceplatform-collector' error
ModuleNotFoundError: No module named 'powa-collector'
ModuleNotFoundError: No module named 'powa-collector'  Hi, My... named 'powa-collector' How to remove the ModuleNotFoundError: No module named 'powa-collector' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'qarealtime-collector'
ModuleNotFoundError: No module named 'qarealtime-collector'  Hi...: No module named 'qarealtime-collector' How to remove the ModuleNotFoundError: No module named 'qarealtime-collector' error? Thanks   Hi
ModuleNotFoundError: No module named 'recipe_collector'
ModuleNotFoundError: No module named 'recipe_collector'  Hi, My... named 'recipe_collector' How to remove the ModuleNotFoundError: No module named 'recipe_collector' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'sdm-collector'
ModuleNotFoundError: No module named 'sdm-collector'  Hi, My... 'sdm-collector' How to remove the ModuleNotFoundError: No module named 'sdm-collector' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'tasks-collector'
ModuleNotFoundError: No module named 'tasks-collector'  Hi, My... named 'tasks-collector' How to remove the ModuleNotFoundError: No module named 'tasks-collector' error? Thanks   Hi, In your python

Ads