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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:19:24+00:00 2026-06-05T05:19:24+00:00

I am having strange problems with BufferedImage, which in some cases consumes all the

  • 0

I am having strange problems with BufferedImage, which in some cases consumes all the free system memory (3GB, 1.5GB free).

I have created a simple wrapper and I use it like this:

public ImageWrapper(final byte[] bytes) throws ImageWrapperException {
    this(new ByteArrayInputStream(bytes));
}



public ImageWrapper(final ByteArrayInputStream bis) throws ImageWrapperException {
    try {
        image = ImageIO.read(bis);
        bis.close();
    } catch (IOException e) {
        throw new ImageWrapperException(e);
    }
}

(I have jsut verified that it happens even with image = ImageIO.read(file);)

I am not getting any exceptions until the first “Cannot allocate memory”.

For some reason, when reading specific type of images, the reading of the image will end up with all the system memory consumed. I am not talking about heap, but really the system memory.

It happens only in certain environments – it does not happen on my OSX, but it happens on my Debian server.

  1. Do you have an idea why this could be happening?
  2. Are there any alternatives to BufferedImage, possibly working better?
  3. The problematic machine is a Virtual Server. Can it be caused by its configuration?

Thanks

EDIT:

  1. Example image: http://cl.ly/1P430l0V1g133r0C291J
  2. It is just the first and only instance which will produce this.
  3. I have just verified that it also happens with: image = ImageIO.read(file); – I am starting to think, that it must be something outside of Java – some native library which is buggy…

EDIT2:

So the problem is with the FileSystem – where I have a 7GB directory with thousands of images inside. When I try to read a file, it consumes all the memory – I suppose it is some kind of Filesystem issue.

  • 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-05T05:19:25+00:00Added an answer on June 5, 2026 at 5:19 am

    There is definitely something wrong with BufferedImage – I’ve tested it on two servers and it was leaking with the same results – System completely out of memory.

    In the end I’ve written a simple wrapper over PHP and I now use GD for image manipulation. Works fine now. Thanks for all the suggestions!

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

Sidebar

Related Questions

I having been running into some strange problems with a webpage that I have
I am having a strange problem which I don't understand. I have the following
I am having some strange problems loading content from another XHTML page via jQuery.
I'm having some problems with deserializing an object. I have following classes: Metadatastore: [DataContract]
Im having some problems sending mail. I have a ubuntu server running postfix as
I'm currently developing a site ( http://landscaping.jvsoftware.com/ ) but I'm having some strange problems
I'm having some strange problems with a site using .net 2.0 and IIS 6.
I've been having some strange problems with the collision code of a game I'm
I'm having some strange problems copying files in a custom script in TFS2008 without
Several weeks ago, my company laptop started having some strange problems. I could no

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.