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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:21:33+00:00 2026-05-11T02:21:33+00:00

I am running my application under a profiler. The ‘class’ that has the most

  • 0

I am running my application under a profiler. The ‘class’ that has the most memory consumption is the char[] which is about 10 kB in my application.

I then created an InputStream (PipedInputStream to be exact) which holds a byte array data of 300 MB.

Then I took a look at my profiler, and I don’t see any significant change ( don’t see anywhere that something eats up 300 MB).

The question is, if that 300 MB of byte array is not in memory, where is Java keeping it?

[Update] Additional info on how I got the 300 MB to my PipedInputStream:

I am developing a web app that has a file upload mechanism. And in one of the processes in my file upload, I create an input stream (PipedInputStream). Basically,

  1. I read the multipartfile’s input stream (a few KB of byte[] at a time),
  2. Created a PipedOutputStream
  3. Created a PipedInputStream (passing the recently created output stream to the constructor)
  4. Wrote the multipart’s input stream to my PipedOutputStream (running on a separated thread; which flushes and closes that output stream before exiting the thread). At this point, I now have a copy of the multipart’s bytes in my own input stream
  5. Then (accidentally) stored that input stream in my http session (discussion/debate on whether that is a good idea would be on a different question)

So the question then again is, where is Java keeping my InputStream‘s content (I don’t see it anywhere in my profiler)?

[Update#2]

I have a FileOutputStream which reads from the PipedInputStream and writes to a file.

  • 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. 2026-05-11T02:21:34+00:00Added an answer on May 11, 2026 at 2:21 am

    A PipedInputStream just makes data available when it’s written by the output stream that it’s connected to. So long as you keep reading from your input stream as fast as it receives data from the output stream, there won’t be much data to buffer.

    If that doesn’t help, you’ll need to give more information about what you’re doing with the piped input stream – what output stream is it connected to, and what’s reading from it?

    EDIT: You still haven’t said what’s reading from your PipedInputStream. Something must be, as otherwise the PipedOutputStream would block – PipedInputStream only have a fairly small buffer (by default).

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

Sidebar

Ask A Question

Stats

  • Questions 123k
  • Answers 123k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I assume that your StoredData div contains these inputs. By… May 12, 2026 at 12:54 am
  • Editorial Team
    Editorial Team added an answer Handle bounces religiously. You will want to use a mailserver… May 12, 2026 at 12:54 am
  • Editorial Team
    Editorial Team added an answer It basically just sets several of the Visual Studio binary… May 12, 2026 at 12:54 am

Related Questions

I am running my application under a profiler. The 'class' that has the most
Does Java 6 consume more memory than you expect for largish applications? I have
What unusual, unexpected consequences have occurred in terms of performance, memory, etc when switching
I am using a quad-core windows XP based Dell Machine machine in my office
I have a windows service and use nlog for logging. Everything works fine when

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.