Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8073359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:19:11+00:00 2026-06-05T14:19:11+00:00

When does the class get loaded in the JVM? Do they get loaded on

  • 0

When does the class get loaded in the JVM? Do they get loaded on the server start up or when there is a reference for the class? My assumption is that all the class gets loaded as the server like jboss starts up but then there is something called lazyloading.

Also what is actually meant by loading? Does it mean there is this .class in the JVM memory along with all the methods, variables including instance, static variables methods and are available for execution. I Know that ClassLoader locates the bytecodes for a Java class that needs to be loaded, reads the bytecodes, checks the refrencces of other class used in the particualr class and loads them as well by creating an instance of the java.lang.Class class. This makes the class available to the JVM for execution

Are methods also loaded in the JVM along with the class? My assumption is that methods are only in the stack memory of threads. then What is method memory? Is it a part of heap or stack?

Do only static methods get loaded along with class loading and not the instance method? Iknow that static bock gets executed when the class get laoded and also all the static variables get initialzed.

Thanks in advance if these doubts get cleared.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:19:13+00:00Added an answer on June 5, 2026 at 2:19 pm

    These are pretty much basic questions about JVM and Google could surely help you with answers.

    For some of your questions (especially for the questions about the actual loading process), you could look here, for example: http://www.securingjava.com/chapter-two/chapter-two-7.html

    On short, at the beginning, just the basic (and trusted) classes are loaded by the JVM. Next, other classloaders (for example the bootstrap classloader) are created as required and they will load some more classes. Before a class can be successfully loaded, all the classes it depends on must be loaded.

    A loaded class is stored in memory in various forms (this is JVM specific), but a Class object is always exposed. Everything inside the class (methods, variables etc.) gets loaded. This doesn’t mean that the class is also compiled (compilation happens later, when a method needs to be executed).

    Allocation of method variables happens either on stack (for primitives) or on heap.

    Initialization of static variables and execution of static blocks happens right after the class is loaded, before any instances of it are created.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get the following error when compiling my app. warning: class 'ConfigureViewController' does not
Can't find the answer to my question in MSND: Does Timer class guarantees that
I have a static util class that does some string manipulation on a bit
I have a class Client like that: public class Client{ public Person Pers {
I understand that the libraries and base classes & controllers get loaded when the
I have a class that looks like this: public class TextField : TextBox {
I was thinking about creating script that would do the following: Get all javascripts
What does class << self do in Ruby ?
What role does SSLSocketFactory class in java play when using HttpsURLConnection ? The java
Class DVD inherits class Media, has one more variable than the base class does.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.