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.

Ads









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
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
Garbage Collection
; In the example we are describing how the garbage collector works... are creating three objects to give the garbage collector something to do, then we... in milliseconds into a long type variable then calling the garbage collector method
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...(); method to show the time take by the garbage collector
garbage collection in java
will learn how to force a garbage collector to work by creating many objects.... First of all we have created an object for the garbage collector to perform...(); method to show the time take by the garbage collector. import
garbage collection
garbage collection  how to use garbage collection in program using core java
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
. The garbage collector determines which objects are no longer referenced... Java Garbage Collection      ... on garbage collection. The name "garbage collection" implies
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
garbage collection implementation dependent java
garbage collection implementation dependent java  How a garbage collection works in Java
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
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
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
What is the purpose of garbage collection in Java, and when is it used?
What is the purpose of garbage collection in Java, and when is it used?  Hi, What is the purpose of garbage collection in Java, and when is it used... of Garbage collection in Java. so Please visit the link and clear your doubts
ModuleNotFoundError: No module named 'anatta_collector'
ModuleNotFoundError: No module named 'anatta_collector'  Hi, My... named 'anatta_collector' How to remove the ModuleNotFoundError: No module named 'anatta_collector' error? Thanks   Hi, In your
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 '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 '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 'coinfo-collector'
ModuleNotFoundError: No module named 'coinfo-collector'  Hi, My... named 'coinfo-collector' How to remove the ModuleNotFoundError: No module named 'coinfo-collector' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'coininfo-collector'
ModuleNotFoundError: No module named 'coininfo-collector'  Hi, My... named 'coininfo-collector' How to remove the ModuleNotFoundError: No module named 'coininfo-collector' error? Thanks   Hi, In your
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 '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 'django-collector'
ModuleNotFoundError: No module named 'django-collector'  Hi, My... named 'django-collector' How to remove the ModuleNotFoundError: No module named 'django-collector' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'dogstatsd-collector'
ModuleNotFoundError: No module named 'dogstatsd-collector'  Hi, My... named 'dogstatsd-collector' How to remove the ModuleNotFoundError: No module named 'dogstatsd-collector' error? Thanks   Hi
ModuleNotFoundError: No module named 'dynatrace-collector'
ModuleNotFoundError: No module named 'dynatrace-collector'  Hi, My... named 'dynatrace-collector' How to remove the ModuleNotFoundError: No module named 'dynatrace-collector' error? Thanks   Hi
ModuleNotFoundError: No module named 'genome_collector'
ModuleNotFoundError: No module named 'genome_collector'  Hi, My... named 'genome_collector' How to remove the ModuleNotFoundError: No module named 'genome_collector' error? Thanks   Hi, In your

Ads