Could this unclosed() byteArrayInputStream cause high Heap usage ?

Hi all,
As part of our reporting integrated with our JSF/JSP application, the
report is converted to PDF then sent to browser for user to display.
mean while during peak load our Heap usage could reach 3.5GB - 4GB. So
I am suspecting the unclosed byteArrayInputStream is the cause.
(This is a production application so I am collecting information
before change the code)
Is the unclosed() byteArrayInputStream really cause the problem ?
(the codes is below)
Thank you,
Krist
ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)
reportClientDoc.getPrintOutputController().export(exportOptions);
reportClientDoc.close();
writeToBrowser(byteArrayInputStream, response, "application/csv",
EXPORT_FILE);
private void writeToBrowser(ByteArrayInputStream byteArrayInputStream,
HttpServletResponse
response, String mimetype, String exportFile)
throws Exception {
byte[] buffer = new byte[byteArrayInputStream.available()];
int bytesRead = 0;
response.reset();
response.setHeader("Content-disposition", "inline;filename=" +
exportFile);
response.setContentType(mimetype);
//Stream the byte array to the client.
while((bytesRead = byteArrayInputStream.read(buffer)) != -1)
{ response.getOutputStream().write(buffer , 0,
bytesRead);}
//Flush and close the output stream.
response.getOutputStream().flush();
response.getOutputStream().close();
}

xtanto wrote:
Is the unclosed() byteArrayInputStream really cause the problem ? Source code from 1.6.12
class ByteArrayInputStream extends InputStream {
     * Closing a <tt>ByteArrayInputStream</tt> has no effect. The methods in
     * this class can be called after the stream has been closed without
     * generating an <tt>IOException</tt>.
     * <p>
    public void close() throws IOException {
    }

Similar Messages

  • Crystal Report export to PDF cause high Heap usage ?

    Hi all,
    As part of our reporting integrated with our JSF/JSP application, Crystal report is converted to PDF then sent to browser for user to display. mean while during peak load our Heap usage could reach 3.5GB - 4GB. So I am suspecting the unclosed byteArrayInputStream is the cause.
    (This is a production application so I am collecting information before change the code)
    Is the unclosed() byteArrayInputStream  really cause the problem ?  (the codes is below)
    Thank you,
    Krist
    ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)
                                     reportClientDoc.getPrintOutputController().export(exportOptions);       
    reportClientDoc.close();
    writeToBrowser(byteArrayInputStream, response, "application/csv", EXPORT_FILE);
    private void writeToBrowser(ByteArrayInputStream byteArrayInputStream, HttpServletResponse
    response, String mimetype, String exportFile)
       throws Exception {
          byte[] buffer = new byte[byteArrayInputStream.available()];
          int bytesRead = 0;
          response.reset();
          response.setHeader("Content-disposition", "inline;filename=" + exportFile);
          response.setContentType(mimetype);
          //Stream the byte array to the client.
          while((bytesRead = byteArrayInputStream.read(buffer)) != -1)
                { response.getOutputStream().write(buffer , 0, bytesRead);}
          //Flush and close the output stream.
          response.getOutputStream().flush();
          response.getOutputStream().close();

    I do not know if my solution to my Heap problem will help any of you but I thought I would just post it here
    just incase yourselves or others come looking for possible solutions.
    I created a very simlpe report with 2 groups and not much in the way of complex functions. Whilst reporting against about
    100 pages of output everything worked fine, but as soon as we pushed the report up to 500+ pages we got all sorts
    of issues.
    java.lang.OutOfMemoryError: Java heap space
    After much hair pulling and trial and error I discovered that the issue came about where I did not declare formula variables as local. I was concatinating various street address details for of the envelope windows.
    Stringvar Address;      //    I was using this declaration
    Global Stringvar Address;    // Specific Global declaration
    Local Stringvar Address;    // Changed to this declaration
    After changing to Local, my report now runs with no hassels. And the memory usage whilst exporting the report has gone from maxing out at over 1GB to almost nothing (dont even get it registering)
    Am sure someone can come up with a better explanation for this and give reasons but just thougth I would share.
    Cheers
    Darren

  • Does entity cache cause high heap usage ? better setClearCacheOnCommit ?

    Hi all,
    During peak load (150-200 users) of our production ADF application (10.1.3.3), the heap usage can be reach 3GB, causing JVM very busy doing frequent GC.
    Is this possibly because the 'by default uncleared' entity cache ?
    What is the implication is I do 'setClearCacheOnCommit()' ?
    Thank you for your help,
    xtanto

    The EO cache will be cleared when the AM is released in stateless mode. By default that would occur when your web session times out, but you can eagerly release it in stateless mode (when the user is finished with the task that uses that AM).
    Using setClearCacheOnCommit() will more eagerly clear the EO cache, however doing so will clear the VO caches, too, for the VOs related to those EOs so it may end up causing more database requerying than you were doing before. Effectively, after a commit you'll need to requery any data that's needed for the subsequent pages the user visits. If your work flow is such that the user does not do a commit and then continue processing other rows that you've already queried, then it might be an overall slight win on memory usage, however if the user does issue a commit (say, from an Edit form) and then return back to a "list" page to process some other record, doing a clearCacheOnCommit=true will force your list page to requery the data (which it's not doing now when the entity cache isn't been eagerly cleared)
    So, like many performance-related question, it depends on exactly what your app is doing.

  • High heap usage even when system idle, is this caused by AMPool setting ?

    Hi All,
    We are running ADF BC 10.1.3.3 with 2 JVM OC4J instance. Max heap is 3.5 GB.
    I notice that when system is idle, the heap usage for each JVM can be between 1.5 to 2 GB. It is confusing me because relatively no user is accessing the application.
    Then I am suspecting that the setting in Apps Module Pool may be the cause, i.e :
    <jbo.recyclethreshold>50</jbo.recyclethreshold>
    <jbo.ampool.maxavailablesize>90</jbo.ampool.maxavailablesize>
    <jbo.ampool.minavailablesize>25</jbo.ampool.minavailablesize>
    Is there anything wrong with the setting that may cause AM Pool Monitor busy doing wrong thing ?
    Thank you for your help,
    xtanto

    mcmillan wrote:
    rohankolay wrote:Right now i have kernel26-2.6.35.4 which i updated on 27 aug. That is around the same time the problem began.Should i downgrade it to kernel26-2.6.35.3 or kernel26-2.6.34.3?
    I think most people have been seeing the problems in any of the 2.6.35 kernels, so 2.6.34.3 would be my recommendation
    +1
    And put kernel26 in IgnorePkg.

  • Applet causes high CPU usage

    Hallo,
    I have a strange problem with my applet. It displays medical images. After loading Image the CPU usage of java jiumps to 100% on single core processors and to 50% on 2 core processors, and stays high, without any interaction of user. I've used Java VisualVM to profile the applet and it says that: javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run() 94.76343 787851 ms (94,8%) 58823 times invoked is
    I'm not sure this is the cause of the problem. I don't use any loops while noone is interacting with the applet. Has anyone idea or suggestion what's going wrong?
    This CPU load is independent of browser and operating system. I've profiled it on firefox.
    with regards
    Rafal Ziolkowski

    Good job figuring it out.
    Rule of thumb to prevent future problems: the paintComponent is used for painting and should do nothing else - setBorder() is a state change and thus does not belong in the paintComponent() method. You can all relate it back to a general programming rule of thumb: a function or method should perform only one task.

  • Mixer window can cause high CPU usage, crashes

    This is probably one of the weirdest bugs I've seen for a while. Here are the steps that I reproduce it for me, maybe someone will want to try this out and see if they get the same.
    1) Open an Empty Project template.
    2) Create 16 instrument tracks when it gives you the dialog. (even 1 will be enough, but the effect is clearer the more tracks you create)
    3) Open the mixer. Either in a window or in the pane.
    4) Now create a "multi-timbral" instrument track with the plus button (use the checkbox there).
    5) Select the 16th track, and now select one of the arrange tracks of the multi-timbral instrument.
    6) Open up Activity Monitor from your Utilities folder in Finder and see how much Logic is taking up CPU. It should be significantly higher than the idle state. On my MBP it'll be around 80%.
    This is not a problem in itself, because when reproducing it like this the high CPU usage goes away when you select another track and won't return if you select the multi-timbral instrument again.
    However, I have sessions where this will continue happening with a multi-timbral instrument all the time. Not only that, I've had Logic crash when this starts happening. And this whole thing will slow down the UI considerably when it's active.
    The workaround that seems to work for me is simply not keeping the mixer window/pane open.

    This is one of the issue which has already been raised to Microsoft and hopefully a public build will be available soon  in next cumulative update pack .
    There are variety of reason for this starting for password mismatch or password not given , SFTP adapter unable to connect and so on .
    There is good post here in below link for this issue
    http://thoughtsofmarcus.blogspot.co.uk/2013/06/leaving-password-blank-in-biztalk-2013.html
    Another greate artcicle is by Nino which states these issues .SFTP adapter is  protocol  sensitive and some configuration by server side, can cause a lot of crazy situations
    http://ninocrudele.me/2014/01/29/checkstat-and-sftp-adapter-issues/
    Thanks
    Abhishek

  • Using FF 12 32-bit in Windows 7 Pro 64-bit cause high mem usage

    AVG gave an alert msg saying "detected high memory usage.
    256 MB".
    It suggest to close and open again.
    Also I notice highest page fault.
    I didn't do anything, just continue to surf as usual.
    I have 4 GB of RAM.
    Do I need to be concern about this?
    Is there a solution to fix this?
    Thanks.

    256MB of Ram isn't really "high" (depending on what you are doing). To put it into perspective. You aren't even using a 16th of your available RAM. AVG is a very poor system optimizer and anti-virus, and often provides false positives.
    You can try doing things like uninstalling add-ons you don't use: [[Disable or remove Add-ons]]
    Update your graphics Driver: [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    Install all Windows Updates, and then test again.
    How many tabs and what were you doing when you received this alert? Did Firefox continue to run normally?
    You can view at any time how much memory Firefox is using by typing about:memory into the address bar.

  • Adobe stuffs cause high CPU usage

    I just download Creative Cloud a few days ago for Primiere CC and since then there is always something from it that causes ~50% CPU usage. I tried to end the process by Task Manager and something else just replace the previous one's place. Sometimes it's CEP Service Manager, sometimes it's Core Sync, CEF Helper, etc. and it's driving me nut! I mean like right now Firefox only takes about 20% while those things just sky rocket the CPU usage. What should I do? How do I stop this?

    Since I installed CC, my laptop has been running very hot too.

  • Wake-On-Lan (WOL) after sleep causes high CPU usage

    Hi,
    I noticed a problem with constant high CPU usage on one of my cores.
    As much as 60% was used.
    The problem occures after I put the system to "sleep" (S3 state) and perform a WOL with a "magic packet".
    I discovered that ACPI.sys+0x1af44 thread was responsible (using sysinternals ProcessExplorer) under the System process.
    If i perform WOL while the machine was shut down everything works perfectly.
    My NIC is  "Realtek PCIe GBE Family Controller" and I'm using the latest drivers.
    I discovered that if I disabled the option in Power Management for the device: "Allow this device to wake the computer", the CPU usage immediately went to normal (without restarting). But enabling it back the high CPU usage resumes. Performing
    another sleep and awaking the system with power button "resets" the CPU usage issue for "good". Until i WOL from sleep again ofcourse..
    I contacted the motherboard manufacturer of the problem but so far no real answer.
    I'm saddened because I need the WOL feature.
    I'm hoping somebody who has more insight in the behaviour of ACPI on W7 can answer my questions.
    Regards
    Specs:
    Model Name : GA-X58A-UD7(rev. 2.0)
    M/B Rev : 2.0
    BIOS Ver : FC
    Serial No. :
    Purchase Dealer :
    VGA Brand : Nvidia      Model : 7950GT
    CPU Brand : Intel      Model : i7 950      Speed : 3.06GHz
    Operation System : Win 7 64-bit      SP :
    Memory Brand : Corsair      Type : DDR3
    Memory Size : 6GB      Speed : 1600MHz
    Power Supply : 450 W

    Hi,
    I noticed a problem with constant high CPU usage on one of my cores.
    As much as 60% was used.
    The problem occures after I put the system to "sleep" (S3 state) and perform a WOL with a "magic packet".
    I discovered that ACPI.sys+0x1af44 thread was responsible (using sysinternals ProcessExplorer) under the System process.
    If i perform WOL while the machine was shut down everything works perfectly.
    My NIC is  "Realtek PCIe GBE Family Controller" and I'm using the latest drivers.
    I discovered that if I disabled the option in Power Management for the device: "Allow this device to wake the computer", the CPU usage immediately went to normal (without restarting). But enabling it back the high CPU usage resumes. Performing another sleep
    and awaking the system with power button "resets" the CPU usage issue for "good". Until i WOL from sleep again ofcourse..
    I contacted the motherboard manufacturer of the problem but so far no real answer.
    I'm saddened because I need the WOL feature.
    I'm hoping somebody who has more insight in the behaviour of ACPI on W7 can answer my questions.
    Regards
    Specs:
    Model Name : GA-X58A-UD7(rev. 2.0)
    M/B Rev : 2.0
    BIOS Ver : FC
    Serial No. :
    Purchase Dealer :
    VGA Brand : Nvidia      Model : 7950GT
    CPU Brand : Intel      Model : i7 950      Speed : 3.06GHz
    Operation System : Win 7 64-bit      SP :
    Memory Brand : Corsair      Type : DDR3
    Memory Size : 6GB      Speed : 1600MHz
    Power Supply : 450 W
    same prob here.  has anyone found a solution?
    ...stephen

  • What Causes High CPU Usage Even When PC is Idle

    How can I fixed the high cpu usage on my pc?

    mcmillan wrote:
    rohankolay wrote:Right now i have kernel26-2.6.35.4 which i updated on 27 aug. That is around the same time the problem began.Should i downgrade it to kernel26-2.6.35.3 or kernel26-2.6.34.3?
    I think most people have been seeing the problems in any of the 2.6.35 kernels, so 2.6.34.3 would be my recommendation
    +1
    And put kernel26 in IgnorePkg.

  • Persistent Active Requests causing high CPU usage and load average

    Hi, we've deployed a JSP application on standalone OC4J talking to Oracle DB. The whole thing runs on Sun Solaris. On some occasions (still investigating what causes this), the number of active requests rises (as seen from EM console) and never drops down. The weird thing is, the load average numbers are proportional to the number of persistent active request. If there are 3 active requests, load avg will be [3.x 3.x 3.x], and whenever persistent active request exist, CPU usage will shoot up to over 90% (usually between 95% - 100%). When the system is running normally, CPU usage is usually less than 20%. Is it possible to track down this problem and how? Many thanks.

    BlueAeon
    Welcome to Apple Discussions!!
    The icons on the right of the menu bar … show a beachball when I put the cursor over themWell, if this was your only problem I would put it down to a corrupt preference or cache file. Nevertheless, it is worth seeing how much this helps.
    The file you need to trash is 'systemuiserver.plist'. But there are potentially two of them, plus it is best to delete your caches as well, so ...
    In "/Users/<yourname>/Library/Caches", delete everything
    In "/Users/<yourname>/Library/Preferences", delete com.apple.systemuiserver.plist
    In "/Users/<yourname>/Library/Preferences/ByHost", delete com.apple.systemuiserver.xxx.plist where 'xxx' is a 12 digit (hexadecimal) numeric string.
    See if this improves the situation, and post back with any remaining oddities.

  • BizTalk 2013 SFTP Adapter : Host Instance configured for SFTP Receive cause high CPU usage

    Hi,
    Our BizTalk 2013 Server test env have 16 GB RAM.  We have one SFTP Receive Location which is using a dedicated Host instance for SFTP receive.
    As soon as we start this SFTP Host Instance it starts consuming 50-60% CPU. (Even when it is not handling any file receive)
    As suggested in below thread, to fix this issue, we changed the SFTP RL default configuration. i.e. Changed polling interval from default 0 sec to
    10 minutes and also changed the RL Schedule window to business hours only.
    https://connectedpawns.wordpress.com/2014/04/13/biztalk-2013-sftp-adapter-biztalk-host-receiving-throttled-because-processmemory-exceeded-the-configured-throttling-limit/#comment-2602
    Even after changing the RL configuration , the Host Instance continuously consumes ~60% CPU.
    Any suggestions to troubleshoot more on this issue ?
    Thanks in advance !!
    Anoop

    This is one of the issue which has already been raised to Microsoft and hopefully a public build will be available soon  in next cumulative update pack .
    There are variety of reason for this starting for password mismatch or password not given , SFTP adapter unable to connect and so on .
    There is good post here in below link for this issue
    http://thoughtsofmarcus.blogspot.co.uk/2013/06/leaving-password-blank-in-biztalk-2013.html
    Another greate artcicle is by Nino which states these issues .SFTP adapter is  protocol  sensitive and some configuration by server side, can cause a lot of crazy situations
    http://ninocrudele.me/2014/01/29/checkstat-and-sftp-adapter-issues/
    Thanks
    Abhishek

  • Call Park service causing high CPU usage

    Hi,
    I've got a Lync 2013 pool with 4 servers running.  Everything is working fine except I notice that when I enable the call park service, the CPU usage goes from hovering at around 4% to jumping all over the place (anything from 11% to 30%).  I've
    not seen this behaviour on any other Lync platform I have deployed.
    All machines are virtuals, running 2 Sockets with 8 cores each.  Each server has 25GB of RAM.  Any perfmon report I run only confirm that the Call Park Service is using a lot of CPU resource (compared with other services)
    Any help greatly appreciated.
    Thanks
    Mike

    Please check if the CPU usage drops down when you stop the call park service.
    Please check the Call Park Configurations are correct by articles at
    http://technet.microsoft.com/en-us/library/gg399014.aspx
    Lisa Zheng
    TechNet Community Support

  • Firefox causing high GPU usage and fluctuations

    I have an NVIDIA GTX 440 graphics card and I like to monitor its speeds and tempratures.
    Ive noticed whenever using firefox even when im just scrolling down a page my gpu clock will shoot up to max (822 mhz) and this will of course cause the fan to speed up and make noise.
    Its kind of annoying cause when im not scrolling its on idle and quiet, and then I scroll down and suddenly it shoots up. Basically its making my gpu go from max to low constantly and I dont think thats very good for my gpu.
    Is there anyway to fix this? I dont see why firefox needs max speed from the GPU.

    There should be an issue in bugzilla for this. It's obvioulsy coding defects. Chrome utilize GPU 3-4 times less than Firefox and works smoother. IE10 utilize GPU 10-13 times less than Firefox and works even more smoother than Chrome.

  • NMIndexStoreSvr.exe causes high CPU usage

    Within 2 - 24 hours after I restart my computer I'll notice that the CPU fan is very loud. When I open Windows Task Manager the CPU is at 95-100% usage. When I look at processes I see that the file "NMIndexStoreSvr.exe" is the biggest culprit. When I end that process, my CPU usage drops to 5% almost immediately.
    Ending this process does not seem to affect Itunes. Has anyone else run across this. Is there a fix or a way to keep that file from running when I start up Windows?
    Any help will be greatly appreciated.

    Hi Adrian1988,
    Welcome to the HP Support Forums, I hope you enjoy your experience! To help you get the most out of the HP Forums I would like to direct your attention to the HP Forums Guide First Time Here? Learn How to Post and More.
    I saw your post regarding the audiodg.exe error message. I did some research into that message and as you mentioned most of it is for Windows 7, I can find very little for Windows 8. What other games do you notice this issue with? I looked into DOTA2 and it lists XP, Vista and Windows 7 under the requirements but doesn't mention Windows 8.
    Thank you,
    Please click “Accept as Solution ” if you feel my post solved your issue.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Thank you,
    BHK6
    I work on behalf of HP

Maybe you are looking for

  • Need to connect an Apple Display with an ADC plug to a Mac Mini with a DVI port

    I have an older Mac Mini (I'd guess at least 4-5 years old, but I have a terrible memory), and I want to connect a Cinema HD Display with an ADC connector plug. Unfortunately, my Mini only has a DVI port, and I cannot find an Apple adapter, or any ad

  • Issue in deploying ORDS.war

    Hi all Gurus I am following the steps from documents trying to setup ords  Installing Oracle REST Data Services to that I can use on listener to point to multiple instance of APEX. Using APACHE2.2 >> GLASSFISH 3.1.2.2(build 5) >> APEX (4.2 and above

  • Installer file damaged Windows 7

    Help! Non - Tech hear.   I get the following message when trying to install an adobe app on Windows 7 OS "The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the application author." I

  • Out standing  downpayment in project

    Hi, I'm trying to close project , but am getting the message that there is an outstanding downpayment on  wbs . How do find out that  which down payment request or downpayment are not cleared for particular wbs. Your valuable  in this regards highly

  • Lookup of Oracle Error Message at application level

    Hi I'm writing a c# application that connects to an oracle database. My application queries a table containing a column with oracle error codes BUT NO ERROR MESSAGES. The application must show these error descriptions to the user. As I cannot expect