• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jvm lazy loading ?

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Does anyone know what lazy loading is in the jvm sense ?

thanks in advance,

J.C
 
Ranch Hand
Posts: 1252
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by James Clarke:
Hi all,

Does anyone know what lazy loading is in the jvm sense ?

thanks in advance,

J.C



Dear James,

The JVM must be able to load JVM class files. The JVM class loader loads referenced JVM classes that have not already been linked to the runtime system. Classes are loaded implicitly because:

The initial class file - the class file containing the public static void main(String args[]) method - must be loaded at startup.
Depending on the class policy adopted by the JVM, classes referenced by this initial class can be loaded in either a lazy or eager manner.
An eager class loader loads all the classes comprising the application code at startup. Lazy class loaders wait until the first active use of a class before loading and linking its class file.

The first active use of a class occurs when one of the following occurs:

*An instance of that class is created

*An instance of one of its subclasses is initialized

*One of its static fields is initialized


Certain classes, such as ClassNotFoundException, are loaded implicitly by the JVM to support execution. You may also load classes explicitly using the java.lang.Class.forName() method in the Java API, or through the creation of a user class loader.

The IBM JVM's class resolution is lazy by default. Specifying the -Dibm.cl.eagerresolution command-line option turns on eager class resolution. Lazy class resolution improves startup time of JVMs. For example, the number of classes loaded in a basic Java test reduces from approximately 1500 to approximately 300 with lazy loading.


I hope it makes you clear you.
If any concern then revert me.
 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic