Solving Tomcat OutOfMemoryError: Heap space and PermGen space

It’s quite common to run In memory problems when running some big Java EE application on a Tomcat server.
Some of the most commmon errors are like the following ones.

This is about a full Heap space:

SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.OutOfMemoryError: Java heap space

This other is about the PermGen space that’s a memory area, where compiled classes (and JSPs) are kept, and this error might happen often if the running web application have many .java and .jsp.

MemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space

To increase the memory available to Tomcat, about heap and permgen the correct options are the following ones.

This sets the max heap available to Tomcat at 1Gb of memory:

--JvmMx 1024

This sets the max permgen available to Tomcat at 256Mb of memory:

-XX:MaxPermSize=256m

To change the Tomcat memory settings (when Tomcat is installed on Windows as system service), it’s required to use the command-line tool tomcat6. The next command changes the memory settings for the Tomcat service named Tomcat6

tomcat6 //US//Tomcat6 --JvmMx 1024 ++JvmOptions="-XX:MaxPermSize=256m"

The label //US//Tomcat6 has the meaning of Updating Server parameters for the service named Tomcat6.
Obviously this command should be executed from the directory C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin or from wherever is the bin directory of your Tomcat installation. Or to make things simple, that directoy should be added to your PATH environment variable.

It’s even possible to update memory settings from a GUI frontend, or to view what happened after running the command line tool. Running the following command:

tomcat6w //ES//Tomcat6

a window will open showing all the parameters about the windows service Tomcat6.

It’s possible to see in this image that, after running the previous command, for setting higher memory limits, in the sections Maximum memory pool and at the end of the Java Options the new memory limits are set.

Tomcat Memory Settings on Windows

Tomcat Memory Settings on Windows

103 thoughts on “Solving Tomcat OutOfMemoryError: Heap space and PermGen space

  1. Now single Russian girls can also be getting career oriented and strive hard despite of every one of the opposition and conflicts to get a stable professional &
    social life. Most software results in sites that rely extensively on PHP
    and My – SQL. The following are five questions you should ask (or get strategies to)
    before meeting with your matches with a real first date.

  2. Pingback: apache - Tomcat 7 CreateJavaVM de Error de Error de

  3. Pingback: apache - Tomcat 7 mise en CreateJavaVM d'Erreur Échec de l'

  4. Thank you for every other great post. The place else could anybody
    get that kind of information in such an ideal means of writing?
    I have a presentation subsequent week, and I’m at the search for such information.

  5. Wonderful blog! Do you have any suggestions for aspiring writers?

    I’m planning to start my own site soon but I’m a little
    lost on everything. Would you propose starting
    with a free platform like WordPress or go for a paid option?
    There are so many options out there that I’m totally overwhelmed ..
    Any recommendations? Cheers!

  6. Sbobet is a trusted gambling site that operates to help all fans of online gambling in the world.
    Founded in 2010, it didn’t agree to long for Sbobet to become
    the biggest online site in Asia and similar to it
    comes to the amount of betting money that rotates all week, Sbobet is in addition to one of the
    biggest sites in the world.

    Sbobet is categorically popular, especially along with Asian bettors, the
    reason is that the site has been awarded as the best gambling operator for two years in a row.
    It offers a variant of football betting following unquestionably low
    margins gone compared to additional sites in its class.

  7. agreeable to Mabosbola, one of the best Indonesian Sbobet agents before 2010.
    Mabosbola.com is Indonesia’s largest Sbobet site that will be
    next to you to international gambling game services. afterward
    several world sites, Mabosbola is an agent site that gives you full permission to various gambling game categories.

    In supporting the services and comfort of our members, Mabosbola is always glad to allow satisfaction to members
    who trust us as Sbobet Indonesia agents. Various popoler gambling betting markets upon Sbobet and as a consequence Maxbet and many others.
    We preserve our title as master agent because of our fine bill both in terms of help and fast payment.
    Not to forget afterward our role as a betting clash for the world
    mug and the Euro as well.

  8. Alternate Link l69
    L69 is among the official sites that provide the most
    recent alternative link trustworthy online
    betting sites. L69 provides more than 1 alternative link from each and every betting site, and all of us here have become one of the most comprehensive alternative link companies and the L69 site includes a responsive display that will makes it
    easy that you should access our site coming from the display of
    your own tool or laptop. In addition to what you need to know
    is that will we here just have one official link, l69. me
    personally and if there usually are other websites that provide information or call our
    website is not the official site.
    Ball betting and casino gambling usually are types of
    games that are incredibly favored by the folks of Indonesia.

    Why l69? Because we’ve been here for a lot more than five a number of possess become the trust regarding the
    individuals of Philippines as a location to play soccer gambling as well
    as on the internet casino gambling. Itself has additionally obtained a license from the Asian and Western governments last year to become an online gambling betting provider site in Asian countries and
    Europe. By offering lots of different types of wagering bets
    that can be played upon one ID, much more the members feel happy playing in your bookie.

    Great things about Alternative Links l69
    Yet sadly lately there are usually many members who encounter problems and problems whenever entering into
    their Sgd777 game since the Sbobet internet site is usually blocked and many older sites have been blocked by the Indonesian authorities and never
    a few are usually also influenced with what is called the Newsletter
    Job. The Indonesian government recently is struggling to eradicate links or paths to
    access sites that smell associated with pornography,
    gambling and there are a number of other content of which is deemed inappropriate.

  9. I think that what you said was actually very reasonable.
    But, consider this, suppose you were to write a killer post title?
    I ain’t saying your content is not solid., however suppose you added a title to maybe grab people’s attention? I mean Solving Tomcat OutOfMemoryError: Heap
    space and PermGen space | Web2.0 Tutorials is kinda plain. You
    could peek at Yahoo’s home page and note how they create
    news titles to grab viewers interested. You
    might try adding a video or a picture or two to grab readers interested about everything’ve got
    to say. Just my opinion, it could bring your posts a little
    livelier.

  10. List of Alternative Linksbo Links
    Today is progressively developing, which makes it simpler for those to access computerized
    networks. Till now there are numerous on the internet gambling games that may be played
    by anyone online. Therefore, wagering lovers no longer
    require to typically the casino to try out gambling, this is fairly easy for them to
    be able to play anytime in addition to anywhere without limits.

  11. I like the helpful information you provide on your articles.
    I will bookmark your blog and test once more right here
    regularly. I am quite certain I’ll learn
    many new stuff proper right here! Best of luck for the following!

  12. Thank you a bunch for sharing this with all of us you actually recognize what you are speaking approximately!
    Bookmarked. Please also discuss with my site =).
    We will have a link exchange contract between us

  13. Bandar Judi Nova88

    Nova88 is one of the better trustworthy online bookies in Indonesia which has been operating given that 2004.
    More than thousand men and women sign-up as official people every single day at Nova88.com for one reason only, namely we
    remain devoted to paying members’ profits. Coupled with the upgraded and even more advanced platform gambling system.
    From the Maxbet server migrated in order to the Nova88 storage space,
    customers will experience a much better gaming knowledge for maximum total gameplay.

  14. For anyone who like to perform gambling and if you are usually looking
    for partners within gambling activities, Mabosbet will be
    the right choice. Mabosbetransfer You can contact our customer care and make
    purchases with us. Mabosbet livechat is available 24 hrs nonstop and is ready to serve you that help you
    online with wagering.

    Mabosbet. com as a new responsible gambling agent, we all always provide an alternative link to mabosbet in order that members feel comfortable.
    You no longer require to have trouble finding an alternative solution Jababbet link for access, it is previously available for you.

    We all also always give top priority to the safety of our members,
    very rigid protecting each of the privacy of members of Jababbet.

    Trustworthy Mabosbet From 2010

    Together with good praise, the services from the Headquarters will be no doubt.

    Friendly, quick response, under 3 minutes.

    Mabosbet is highly highly valued by gambling bettors coming from Indonesia because whatever success
    you get will be accepted by mabosvip. We always want to provide
    the great for members with optimum service. The site mabosmail.
    com can also be very straightforward to access, as you only
    require internet access and alternative links mabosvip, no
    require to use proxies, newsletters, or troublesome applications.

    That is why many individuals join mabosbola and create deposits, then, win the particular
    match. The best in addition to quality alternative mabosbola alternate site.

    Come join mabosbet. com the trusted on-line gambling agent in Indonesia.
    Contact livechat mabosbet right now in the lower correct corner to get the user
    ID. Welcome to the club.

    MABOSBET is a Trusted Online Wagering Site that has recently been established for more as compared to 9 years with the particular most significant
    quantity of online wagering players. This gambling site also provides the most complete online gambling game with the most popular wagering
    providers in Indonesia. Online Gambling Games that could be played
    at MABOSBET are Sportsbook Soccer Wagering, Live Casino, Internet poker Cards
    Gambling, Online Slot Gambling and Online Togel. Mabosbet itself has provided
    a variety of excellent facilities for online gambling players
    in Indonesia ranging from 24-hour Live Chat Support, Bonuses with the simplest conditions, additional wins
    for True Gambling Players.

    This particular MABOSBET Gambling Site furthermore proves to get very trusted, while this Gambling Site can also pay for any
    winning player without the deductions. So you will play gambling
    comfortably plus safely without fear of having to pay.
    In addition to the definite win at MABOSBET, you will also offer
    additional bonuses to supply a different experience
    enjoying online gambling.

    JOBI GOLF BALL OFFICIAL SBOBET ONLINE INSIDE INDONESIA
    Online Soccer Wagering has become a really
    popular internet gambling game inside Indonesia where every online game has a market with regard to betting.
    MABOSBET has become a good official partner of SBOBET Indonesia, where more
    than a decade has provided sports gambling games for wagering players in Indonesia.

    This specific SBOBET Soccer Gambling Industry allows a good where
    gamers will actually be provided with a new live market through the recognized match directly.
    So you will be very lucky in order to play SBOBET in this particular MABOSBET.

    RELIABLE ONLINE SLOT MACHINE GAME SITE SITE NUMEROUS EARNINGS
    Online slot gambling is usually currently popular in Dalam negri, where online slots are
    really successful with huge jackpots and freespins that are straightforward to win. Because of that this MABOSBET first provided Online Slot Online games from 2012 for betting
    players in Indonesia. Wherever Jackpot is provided even more than USD $ one, 000,
    000 for slot machine game players who register in MABOSBET.
    The Slot Game machine at MABOSBET won’t just use your Balance,
    the Slot Game has been made with the FREESPIN Bonus that comes away more often,
    so an individual will probably be Fortunately.

Leave a Reply

Your email address will not be published. Required fields are marked *