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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:50:50+00:00 2026-05-23T06:50:50+00:00

I am using an automatic generated Java class for executing a special method. Because

  • 0

I am using an automatic generated Java class for executing a special method. Because of this i have to invoke the method by reflection.

This execution is triggered by a Swing Thread, because the method (invoked from the “unknown” class) is updating a UI Element. Every execution of a new Thread is searching for a Method in the class by calling

Class {
...
public Method[] getMethods() throws SecurityException
...
}

The logic of getMethods, caches the element, but i do not know why. A Profiler shows me, that Method obejcts are floating the memory.

I can disable the method caching of Java by setting the system property “sun.reflect.noCaches”, but my application became incredible slow, after i changed these property.

Question:
I could implement my own caching algorithm, before i try to get the method from the class. But the project i am working is very big and we have multiple reflection calls.

What can solve these problem?

Which cirumstances can trigger these memory leak (wrong classloader,…)?

The project is running under Linux using Java 1.5

  • 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-23T06:50:50+00:00Added an answer on May 23, 2026 at 6:50 am
    1. First thing, the cache that it uses is a SoftReference, so the cached methods will be removed before an OOME ever occurs.

    2. If you still want to remove it, just call the clearCachesOnClassRedefinition() method after every call to getMethods(..); you will have to use reflection as the method is private.

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

Sidebar

Related Questions

If I define a struct in C# using automatic properties like this: public struct
I'm using Automation to get_Text from an Excel worksheet. I do this because I
I'm using TestNG to run Selenium based tests in Java. I have a bunch
I am using the standard .Net 2.0 DataGridView with sort mode of automatic on
I'm using SQLAlchemy 0.5rc, and I'd like to add an automatic filter to a
How would I generate automatic bindings for a C project that is built using
I need to create an automated process (preferably using Java) that will: Open browser
I am preferring to manually migrate my tables in Django. Because using automated tools
Has anyone got EclipseLink MOXy (I'm using eclipselink 2.1.0) to work with Java 5?
we're using SugarCRM as the back-end for a web application. We automatically generate Java

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.