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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:29:14+00:00 2026-05-14T02:29:14+00:00

I get a java.lang.outOfMemoryError exception, while writing a big file to the servletOutputStream. Every

  • 0

I get a java.lang.outOfMemoryError exception, while writing a big file to the servletOutputStream.
Every response is by default wrapped using a ehcache.constructs.web.filter Object for GZIP compression. And as per the logs, the exception is thrown in the Filter object.
Is there a way to increase the available memory so, that the outOfMemoryError Exception does not occur ?

  • 1 1 Answer
  • 1 View
  • 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-14T02:29:14+00:00Added an answer on May 14, 2026 at 2:29 am

    You need to add the option “-Xmx1024m” to the java command which runs your servlet container. (Replace 1024m with whatever heap size you like; this means 1024 megabytes.) If you’re using, say, Tomcat, then this means you set this in the environment variable CATALINA_OPTS. Your server configuration will vary.

    However, the problem is buffering such a big file in memory. This is wasteful. Try this compression filter, which doesn’t buffer this way:

    http://sourceforge.net/projects/pjl-comp-filter/

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

Sidebar

Related Questions

i get this exception frequently when running my app on tomcat using eclipse: java.lang.OutOfMemoryError:
Why do I get a Exception in thread AWT-EventQueue-0 java.lang.OutOfMemoryError: Java heap space because
I get the following warning when using java.net.URLEncoder.encode : warning: [deprecation] encode(java.lang.String) in java.net.URLEncoder
I get 12-21 21:19:09.384: ERROR/AndroidRuntime(4063): java.lang.OutOfMemoryError Thanks! @Override public void initScene() { //openOptionsMenu(); //plane
I am looking to use Java to get the MD5 checksum of a file.
I have a thread in a Java web application that causes a java.lang.OutOfMemoryError: Java
In my app I am checking GPS strength. I get an java.lang.IllegalArgumentException : listener==null.
I have a problem with a junit ant build, i'm getting a java.lang.OutOfMemoryError: PermGen
When I get a java.io.InvalidClassException, it gives me the serialVersionUID that it wants, and
I'm trying to get into java again (it's been a few years). I never

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.