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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:30:25+00:00 2026-06-05T09:30:25+00:00

I use tomcat7. My web-app contains: hibernate log4j jdom upload jar mysql driver …

  • 0

I use tomcat7. My web-app contains:

  • hibernate
  • log4j
  • jdom
  • upload jar
  • mysql driver
  • …

the total of lib is 30 jar files. My hoster says: “A lot of memory is allocated to the your program(for Perm gen and heap). Please reduce the amount of memory consumed“.

How do I reduce the memory requirements of my program?

How can the reduce the perm gen memory?

please help me.

  • 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-05T09:30:27+00:00Added an answer on June 5, 2026 at 9:30 am

    You should probably attach a memory profiler first and see what type of memory is being used and why. The answers to this question list a bunch of profilers you could try.

    Heap is all the memory you allocate for storing objects in Java. Every time you use “new” you allocate on the heap and the memory will become garbage collected some time after the last reference to it is cleared. Here are some typical things you might do to reduce heap usage: Switch from an in-memory parsing API to a streaming one, perhaps by using StAX or SAX instead of JDOM. Fix memory leaks or simply longer-than-necessary object retention by cleaning up in a finally block as soon as the object is no longer needed. Optimize SQL queries to make them return only exactly the necessary data to the app, perhaps by adding a max row constraint or a more restrictive where clause. Limit the size of uploads and stream them to temp files on disk instead of keeping them in memory.

    Perm gen is “permanent generation”. Generally, memory in the perm gen is never freed until the JVM exits. It is mostly used to store loaded classes. So anything you can do to load fewer classes helps here. Here are some ways to load fewer classes: Try not to use multiple versions of the same jars. Try to load jars in the widest context possible, preferring Tomcat’s lib directory or a shared lib directory over WEB-INF/lib. Minimize reloading of the webapp because every time you reload a webapp in Tomcat, it doesn’t unload the old versions of all classes it simply loads the new ones.

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

Sidebar

Related Questions

Our web app contains both index.html and index.jsp, and we use Apache Tomcat 6.
I have web app in jsf2.0 on tomcat 6 and MySQL. I'm using special
I want to use Maven 2 for buliding Web App using Spring 3.05 and
I want to use connection pool with JPA/TopLink in my web app running on
Consider the following implementation of Web app and Client - that uses Spring/Hibernate for
I am having a problem configuring my web-app to use Spring security on Virgo
I am switching to use Maven for my Spring web app projects and I
I would like to use the Java assert keyword in my Spring web-app, primarily
I have a web-app, which I deploy on Tomcat 6 and it uses Hibernate.
I am developing an web app using java/j2ee as middle ware and Mysql 5.1

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.