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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:56:55+00:00 2026-06-18T07:56:55+00:00

I have a utility that I built, and for being such a small purpose-built

  • 0

I have a utility that I built, and for being such a small purpose-built utility I was very surprised when I noticed during testing that it was using 150mb of memory. I ran it with a heap setting of 1MB and it still took up more than 50mb.

After profiling and spending a day trying to figure out where I went wrong, I decided to test a theory. My utility connects to a proprietary application. That connection requires an external library provided by the application vendor.

I wrote a small Hello World using the library and noticed the following:

1) declaring a new object from the vendors library immediately bumps the memory usage to 50MB (mostly permgen space)

2) actually trying to connect to an application server will bump the memory usage to 150MB.

That’s just plain silly as far as I’m concerned.

I’m wondering if there is any potential way to tame the beast. Maybe somehow unload classes that I know aren’t necessary or won’t ever be referenced. The vendor isn’t going to change things any time soon.

Or what about maybe loading the vendor’s library only when necessary? That way it only eats up so much memory while communicating with the app server.

  • 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-18T07:56:56+00:00Added an answer on June 18, 2026 at 7:56 am

    The JVM only loads classes you actually use. In fact it only load methods you actually use. e.g. if you have a byte code bug in a method you don’t use, you won’t know. 😉

    The best way to reduce the size of the vendors library is to ask them to improve it, or write your own.

    Unfortunately allot of propriety application are not very resource friendly. Their first priority is correctness. :j

    BTW: 150 MB of memory costs about $6 so I wouldn’t spend allot more than that much time trying to fix it.

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

Sidebar

Related Questions

We have a native C++ Win32 .exe built using Visual Studio 2005 that works
I have a legacy VB6 application that was built using MSDE. As many client's
I have a utility build script that gets called from a variety of project-specific
I have a utility that I have written in VB.net that runs as a
I have a WinForms utility that I use constantly, and enhance regularly. Roughly one
I have a utility class that creates & returns a db connection: Public Shared
I have a linux utility that parses structured input ( a text file ),
I have a utility class that needs to work on a generic Class but
I have a question regarding the creation of a utility that executes another command.
You may have heard of PawSense , a Windows-only utility that prevents keystrokes from

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.