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

  • SEARCH
  • Home
  • 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 4074532
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:10:59+00:00 2026-05-20T17:10:59+00:00

During the execution of a Java application, are object references used by the runtime

  • 0

During the execution of a Java application, are object references used by the runtime or are they stripped away at compile time?

I guess I could decompile class files and see how they are used as local variables and member variables.

Is it wasteful to create an object reference when you don’t need to or will the compiler strip away unneeded references?

E.g.

final String abc = “abc”;
method(abc);

as opposed to:

method(“abc”);

  • 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-05-20T17:10:59+00:00Added an answer on May 20, 2026 at 5:10 pm

    Methods are stored in the object data area (as laid out by the class definition), but block local references are stored in a special area of the JVM stack frame. When the frame pops off of the frame stack of the executing thread, all the block local references are lost as they are not actually stored in the object’s data structures.

    Note that if you are unfamiliar with JVM stack frames, a new stack frame is obtained for the entry into every method, and is popped off the Thread’s stack when returning from a method. Stack frames contain a number of elements, including a pointer to the current instruction (which is located in the Class’s instruction pages) a pointer to the “this” object, and a small stack to hold intermediates in the current method calculation. Sometimes a variable reference doesn’t incur any need for storage, and many optimizing compilers will then compile out the code to use the local stack instead of the “object reference storage” meaning that reversing of the code will result in not discovering that the person used a variable at all.

    The “this” pointer always occupies the first entry in the object reference storage area, and all of these concepts are conceptual. The actual implementation only needs to conform to the operational standard, it doesn’t need to conform to a particular memory layout.

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

Sidebar

Related Questions

During execution, how can a java program tell how much memory it is using?
I use a Java Socket object in my client application. I need to know
I have written a servlet java program. During the execution of one particular loop
I'm currently working on a JavaScript tool that, during the course of its execution,
During my apprenticeship, I have used NHibernate for some smaller projects which I mostly
Is it possible to execute groovy code dynamically loaded in java application. For example
I am working on a Java application that will use some Hibernate (annotated by
I've been doing object-oriented programming for most of the past 7 years, using Java
I'm going to implement a (simple) downloader application in Java as a personal exercise.
When I measure the throughput of my Java application, I see a 50% performance

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.