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 7779881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:45:42+00:00 2026-06-01T18:45:42+00:00

I recently came across this interesting term and searched on Net to know more

  • 0

I recently came across this interesting term and searched on Net to know more about it. However the info I found is sketchy. Could someone pl. give me a somewhat detailed explanation of what this is and why is this useful?

From the info I found, it looks like this mechanism makes reflective method execution faster, at the expense of creating a lot of dynamic classes and hogging perm gen memory area, but I’m not sure about it.

  • 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-01T18:45:44+00:00Added an answer on June 1, 2026 at 6:45 pm

    Did some source code digging and coding myself to figure this out, and here’s what I’ve found out:

    Java’s ‘Method’ class has a member variable ‘methodAccessor’ of type ‘MethodAccessor’ which is an interface with a method ‘invoke’, similar to Method’s invoke. Methods’s invoke delegates to methodAccessor’s invoke.

    If inflation is enabled (noInflation is false) this accessor points to an implementation which uses JNI to run this Java method (I think using api’s like GetObjectClass, GetMethodID and Call*Method). This is like duel dispatching, and execution with JNI is slow due to this and other reasons.
    ( What makes JNI calls slow? )

    After 15 executions of a method through reflection (’15’ is default and can be changed) and with noInflation false, the JNI based accessor creates a class on the fly (the name is dynamically generated, e.g. say ‘GeneratedMethodAccessor1’) which also has the invoke method. Now, within this ‘invoke’ method, it casts the first ‘obj’ argument to its corresponding class, and then calls the target method on it. It then creates an instance of this class, and changes the methodAccessor settings such that every execution of the method henceforth is delegated to this instance instead of JNI accessor. This is called inflation.

    Because this instance is of a Java class which delegates to a Java object, the delegation henceforth is a normal Java delegation. It never goes to JNI and hence saves that overhead, plus JITC can perform other optimization on it due to which it becomes efficient.

    The downside is, if a lot of methods are inflated in this manner, their classes occupy permgen space and can possibly cause out of memory error.

    For details, see:

    http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/tip/src/share/classes/sun/reflect/ReflectionFactory.java

    http://java.sun.com/docs/books/jni/html/fldmeth.html

    http://anshuiitk.blogspot.com/2010/11/excessive-full-garbage-collection.html

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

Sidebar

Related Questions

I recently came across a question about sequence points in C++ at this site,
I recently came across this website: http://studiostyles.info , which contains a list of color
I recently came across this problem and found a solution but I'm wondering if
I recently came across this term and I was wondering if there is anyone
I recently came across this blog post Yet another post about gamma correction which
heya! i recently came across this statement larger sobel operators are more stable in
I came across an interesting comment in php.net about serialize data in order to
What is scchema importer Extension class in .net webservice.Recently i came across this class
recently I came across this term,but really have no idea what it refers to.I've
I recently came across this line in a PHP script: $_REQUEST['start_date']=$date; Is it allowed

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.