I am running my application under a programmer. The 'Class' has the most memory consumption in the form of char []
which is approximately 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 did not get any significant change (I do not see anywhere that has a 300 MB account).
The question is, if the 300 MB byte array is not in memory, where does Java hold it?
[Update] How additional information has I received 300 MB from my PipedInputStream
:
I developed a web app I am having file upload mechanism and in one of my file uploading processes, I make an input stream ( PipedInputStream
). Basically,
- I read the input stream of multipartfile (one byte [some KB]] at a time,
- one
PipedOutputStream
- created a
PipedInputStream
(recently built output stream for manufacturer) - In my
PipedOutputStream
multipart input stream Written on separate thread, which flushes the output stream before exiting the thread and closes). At this point, I now have a copy of the multipart byte in my own input stream - Then (accidentally) the input stream was stored in my http session ( Discussion / debate will be a good idea on the second question)
Then the question is, while keeping Java the contents of my InputStream
(I don ' Check it out anywhere in my profiler)?
[Update # 2]
I have a FileOutputStream
that reads PipedInputStream
and Writes in a file.
A PipedInputStream
creates data, when it is written by the output stream Until it is connected to it, unless you keep reading through your input stream faster, unless it receives data from the output stream, there will not be too much data to buffer.
If that does not help, you should give more information about what you are doing with the pipes input stream - what is it related to the output stream, and what is reading from it?
Edit: You still do not have to say what should be reading from your PipedInputStream
because otherwise the PipedOutputStream will block
- PipedInputStream
has only a small buffer (by default).
Comments
Post a Comment