OutOfMemory while uploading/downloading a large file

Hello,
We have recently been experiencing OutOfMemory errors in production. We find that whenver there is reasonable load and some user tries to download a 20MB zip file served from weblogic, the server throws OutOfMemoryError.
How does Weblogic handle large file upload / download request? Is it possible to crash the weblogic server by initiating a huge file upload (in the order of 200MB)?
Will this be kept in memory?
like wise for downloads, what is the maximum size of the file that can be served by weblogic? Is there any memory implication? (other than the response buffer size) Will the entire file be cached in memory by weblogic when a download request gets served?
Please help!
Thanks!
Dheepak.

Hi Dheepak, Are you using a special servlet to download the zip? The default servlet always buffers only buffer_size no of bytes and then flushes it as soon as it exceeds. The default buffer size is around 8k, so you should see multiple flushes of 8k each.
The file is not kept in memory or cached in anyway by the server itself buf I can imagine a custom servlet/filter doing that.
For uploads, WebLogic just creates an inputStream over the underlying socket inputstream and returns it to the user. So again there is no caching of data other than the inter buffers which again arnt more than 8k.
Hope that helps
Nagesh

Similar Messages

  • Downloading a large file

    Below code to download file in jsp application.
    What change would give the positive results for downloading a large file.
    In below code what would be the value of
    [XXXXX]
    byte[] buff = new byte[XXXXX];
    if I want to download a very large size file about 1000 KB.
    response.setContentType(getResponseContent(strFileExtension));
    response.setHeader("Content-Disposition","attachment;filename="+strFileNameToDownload);
    response.setContentLength(new Long(file.length()).intValue());
    bis = new BufferedInputStream(new FileInputStream(file));
    bos = new BufferedOutputStream(response.getOutputStream());
    byte[] buff = new byte[4 * 1024];
    int bytesRead;
    while (-1!=(bytesRead=(bis.read(buff,0,buff.length)))) {
         bos.write(buff,0,bytesRead);
    bos.flush();

    Thanks for information.
    Actually i have problem in downloading the file.
    I get below exception on server side when i download file.
    File is downloading without any problem in client browser.
    But i get the following error on Server Console
    java.lang.IllegalStateException: getOutputStream() has already been called for this response
    Any suggestion /reasons for the problem.

  • Download several large files - get CONTROL_FLUSH_ERROR

    Dear all,
    I want to download several large files from the application server to frontend with function module GUI_DOWNLOAD. I use a loop over the several filenames and download the files with following code:
      DATA: l_append        TYPE as4flag,
                 l_count         TYPE i,
                 l_max           type i    value 50000,
                 ls_ziel         TYPE string,
                 ls_download_txt LIKE LINE OF gt_download_txt,
                 lt_download_tmp LIKE gt_download_txt.
      CONCATENATE p_front gs_sel_table-selname '.' 'txt' INTO ls_ziel.
      IF NOT gt_download_txt[] IS INITIAL.
        LOOP AT gt_download_txt INTO ls_download_txt.
          APPEND ls_download_txt TO lt_download_tmp.
          IF l_count = l_max.
    CALL of FUNCTION MODUL GUI_DOWNLOAD    
            REFRESH lt_download_tmp[].
            CLEAR l_count.
            l_append = 'X'.
          ENDIF.
          l_count = l_count + 1.
        ENDLOOP.
    If I only download one large file, there is no problem. But when I want to download more then one file the function module returns the error CONTROL_FLUSH_ERROR.
    I can not say at which file the error occurs (2nd, 3rd, ...) I think it depends on the file size. Several smaller files are no problem. At two large files I get the error.
    Does anyone has an idea?
    Kind regards,
    Sven

    Hi,
    Please check this thead perhaps it may help.
    Re: CONTROL_FLUSH_ERROR with GUI_DOWNLOAD
    Regards,
    Ferry Lianto

  • When downloading a large file, like a movie Internet Explorer automatically provides one with the choice of where to save it - e.g. "C" drive, but Firefox doesn't. How can it be done?

    When downloading a large file, like a movie, Internet Explorer automatically opens a download window offering the choice to "Open" or "Save"the file. This provides one with the choice of where to save it - e.g. "C" drive, in the "My Documents" or "Desktop" folders but Firefox's download window doesn't. This has always frustrated me because I would rather use Firefox exclusively to access the Internet, but when it comes to saving files downloaded off the Internet, sadly, I have to revert to IE!

    If you click on Firefox from the upper-left, then Options, a new window should appear. On that window, click on the general tab. In the middle of the window, you'll see options regarding your downloads, one of which says, "Always ask me where to save files." Click on the bubble for this options, then click Ok. From then on, you should always be prompted on where you want your files saved.

  • An error occurred while uploading one of your files. Please check your network connection and click Retry to resend your file

    Just for the record:
    I had received the error message "An error occurred while uploading one of your files. Please check your network connection and click Retry to resend your file" after all data apparently had been uploaded.
    After trying everything recommended on the internet, I finally found the culprit: Glimmerblocker, an ad blocker!
    (GlimmerBlocker version 1.4.16, Mac OS X 10.7.2 Lion)
    Actually, the credit goes to the very patient German Apple support: they had finally asked me: "what software have you installed lately" ... a big applause to the guys there!
    Best,
    Gabriel.

         In our case, it was not third party software, but a problem with our router not accepting pings.  If you are using a router be sure to set-up Enable WAN Ping Respond,  in the advanced settings.  I reviewed my wireless router's logs and found that it was blocking ICMP Type 3 packets from Apple's server.  As a result, it would give the message, "An error occurred while uploading one of your files.  Please check your network connection and click Retry to resend your file."  You can find the blocked packets in your log based on the time you clicked the buy button for your iPhoto purchase (in my case about a dozen times).  If your packets are blocked, then that is your problem.
         I should have suspected it was the connection since the message plainly said, "...check your network connection...".  However, I discounted this along with so many others based on the forums, since I could connect to the internet.  If there only was a way the message could have gave a little more saying, "Enable your WAN Ping Respond now, or else!"
    Good fortune on your road to Macenlightenment!

  • While uploading data from local file

    Hi,
    While uploading data from local file having the header text into interal table using the GUI_UPLOAD function module,there is problem in upload because of header text in file, do we have any option in this FM itself to skip this header text and upload from sdecond line because as per our requirement we can't delete this header text from the file.

    Hi Manish,
    Do you have the problem while uploading? Is it giving any error?
    If not, if your uploading is successful into the internal table, then delete the first row, which is header, from the internal table using index eq 1.
    Regards,
    Chandra Sekhar

  • I'm downloading a large file through Safari, but it keeps returning to the homescreen and the download stops. How do I stop this?

    I'm downloading a large file through Safari, but it keeps returning to the homescreen and the download stops. How do I stop this?

    If it's not a jpeg or PDF, you can't download it on the iPad.

  • IPhoto cards: "An error occurred while uploading one of your files."

    Hey, all.
    I've been trying to print some cards via iPhoto (version 6.0.6) but, while some are successful on the first attempt, others just keep generating the following error message no matter how many times I try them: "An error occurred while uploading one of your files."
    I'm at a loss. They assemble fine. They connect fine. They transfer fine. Then I just get this irritating message over and over and over...plus my credit card company keeps calling about "unusual activity" (which would be the multiple "pending" charges for the same dollar amount that each of these tries generate).
    I've tried searching these forums and, while others seem to have had this problem, I've yet to read an actual solution.
    And I've tried contacting Apple but they've been, in a word, useless. Polite, but useless.
    Any suggestions?
    Thanks!
    Message was edited by: theshadowalker

    theshadowwalker
    like, say, panning the image
    What do you mean by "panning"? The only time I've heard this term is with video, referring to moving the camera from right to left. So, if you can explain how what you mean by this it might help.
    While there are reports on this forum about folks having issues uploading, compared to the sheer volume of photo orders Apple process it's quite a small amount, and certainly not enough to suggest a systemic fault.
    And I'd already tried removing the pictures and cards from iPhoto, then halving the pictures' size (MB) in Photoshop, then recreating the whole lot from scratch. Still, no effect.
    Can you explain how you did this? What interaction have you set between iPhoto and Photoshop?
    Other than that: Start with the troubleshooting basics:
    1. Repair Permissions using Disk Utility
    2. Delete the com.apple.iPhoto.plist file from the HD/Users/ Your Name / library / preferences folder. You'll need to reset your User options afterwards.
    3. Create a new account (systempreferences -> accounts) and see if the problem is repeated there. If it is, then a re-install of the app might be indicated. If it's not, then it's likely the app is okay and the problem is something in the main account.
    4. What color profile are these images? Have they been processed in Adobe Lightroom or other software before iPhoto? What's the source of the images - Camera? Scanner? Other?
    Regards
    TD

  • "an error has occurred while uploading one of your files "

    Using iLife '06, I've completed a book in iPhoto. I'm trying to buy it -- it goes through the assembling process and right before it's finished it says:
    "an error has occurred while uploading one of your files"
    But no other explanation is given. Same thing over and over and it always happens right beofre it finishes.
    Any ideas what's causing this?

    I can't tell you whats wrong but all i do is reboot iphoto, or worst case, restart the mac. and the next time it goes through like a whiz. I placed orders for 24 separate books this week and i have had everything imaginable go wrong but almost everything worked after restaring iphoto.....corrupt file, cannot authenticate user, cannot get credit card approval, problem with file transfer. Don't bother to use the RETRY button. email support was courteous and within 48 hours for other matters not solved by restarting.
    Van
    Using iLife '06, I've completed a book in iPhoto. I'm
    trying to buy it -- it goes through the assembling
    process and right before it's finished it says:
    "an error has occurred while uploading one of your
    files"
    But no other explanation is given. Same thing over
    and over and it always happens right beofre it
    finishes.
    Any ideas what's causing this?

  • Access HttpContent data while downloading a large file

    Hello,
    for downloading large files methods such as ReadAsByteArrayAsync and ReadAsStreamAsync are inefficient because everything is being cached in memory and you can't access either the byte array or the stream until the await call returns (at this point the entire
    file has been downloaded).
    HttpClient client = new HttpClient();
    Task<HttpResponseMessage> responseTask = client.GetAsync(new Uri("http://video.ch9.ms/ch9/f04f/87cd2a8d-cf52-4b80-bd97-b089e6b2f04f/308MicrosoftAnalyticsPlatformSystemM02_high.mp4"));
    HttpResponseMessage response = await responseTask;
    Task<byte[]> contentTask = response.Content.ReadAsByteArrayAsync();
    byte[] content = await contentTask; // when this call returns the entire file has been downloaded and file data is finally accessible
    Is there a more efficient method to download large files and also to be able to access file data while the download is still running?
    Thx
    Steve

    and if you realllly wanna do it. i think you have to do something like this; but you will have to use a stream
    HttpClientHandler handler = new HttpClientHandler();
    HttpClient client = new HttpClient(handler);
    var response = await client.GetAsync("http://video.ch9.ms/ch9/f04f/87cd2a8d-cf52-4b80-bd97-b089e6b2f04f/308MicrosoftAnalyticsPlatformSystemM02_high.mp4", HttpCompletionOption.ResponseHeadersRead);
    var responseStream = await response.Content.ReadAsStreamAsync();
    byte[] buf = new byte[512];
    int bufSize;
    while((bufSize = (await responseStream.ReadAsync(buf, 0, buf.Length))) > 0)
    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

  • Upload/Download speed of files using Java

    Hey All,
    I have created a signed Java applet which, among various other things, allows uploading and downloading of files between the server and client. Both Upload and Download is handled through HTTP. For Upload I create a multi-part POST request to transfer the data to a script on the server which intercepts it. For download I craft a URL to http://myserver.com/filedirectory/file.extension. From that I form a HttpURLConnection and read from the stream to the file system of the client. This applet is only run on an internal network, which currently has 100mbit connection. However, I am noticing upload/download speeds of less than 1MB/s (I believe 100mbit = 12MB/s approx). I am currently using a buffer size of 8kb.
    Can anyone think of any ways to increase download speed? Would it help to increase the buffer size, knowing we will always be on a closed network? Here Is my upload code, and my download is similar but in the opposite direction.
    int bytesRead = 0;
    byte b[] = new byte[BUFFER_SIZE];
    BufferedInputStream bufin =  new BufferedInputStream(new FileInputStream(f));
    while ((bytesRead = bufin.read(b)) != -1)  {
            * write output
         out.write(b, 0, bytesRead);
         out.flush();
    out.close();
    bufin.close();I have not included the rest of the code which creates the POST request because the upload is otherwise working perfectly despite the speed, and I have confined the bottleneck to this part using debug output.
    Thanks much

    Will removing the flush after every loop somehow decrease accuracy?No.
    Ideally, files should be the same exact size on the server as the client after upload has finished.Deferring the flush() can't change that. It just lets you write in larger chunks, which is always good.
    Which one is the socket receive buffer?The buffer whose size is set by Socket.setReceiveBufferSize().
    Currently the size of BUFFER_SIZE in the example above is set to 8k.That's the application buffer. Good size.

  • Error while uploading an edited excel file into an internal table

    Hi Experts,
    I am getting error while uploading an excel file that has been edited.
    I am using GUI_UPLOAD for uploading the file into internal table.
    In my program I first have to download a file, if I use the same file without editing I am able to read the file.
    When I try to edit it and then use it to upload it fails, but this is part of the my requirement.
    PLease suggest.
    Regards
    Kishore

    TYPE-POOLS: truxs.
    parameter :    lv_full_path     TYPE rlgrap-filename,
    data : lt_conv_data   TYPE truxs_t_text_data,
              lt_roles_excel   type table of ( your structure).
    start-of-selection.
            CALL FUNCTION 'SAP_CONVERT_TO_XLS_FORMAT'
              EXPORTING
                i_line_header        = 'X'
                i_filename           = lv_full_path
              TABLES
                i_tab_sap_data       = lt_roles_excel
              CHANGING
                i_tab_converted_data = lt_conv_data
              EXCEPTIONS
                conversion_failed    = 1
                OTHERS               = 2.
    In the FM Line_header = 'X' means it will negelect the first line. So u can give the heading in the excel file.
    Hope this might help u .
    With Regards,
    Sumodh.P

  • Upload and Process large files

    We have a SharePoint 2013 OnPrem installation and have a business application that provides an option to copy local files into UNC path and some processing logic applied before copying it into SharePoint library. The current implementation is
    1. Users opens the application and  clicks “Web Upload” link from left navigation. This will open a \Layouts custom page to select upload file and its properties
    2. User specifies the file details and chooses a Web Zip file from his local machine 
    3. Web Upload Page Submit Action will
         a. call WCF  Service to copy Zip file from local machine to a preconfigure UNC path
         b. Creates a list item to store its properties along with the UNC path details
    4. Timer Job executes in a periodic interval to
         a. Query the List to see the items that are NOT processed and finds the path of ZIP file folder
         b. Unzip the selected file 
         c. Loops of unzipped file content - Push it into SharePoint library 
         d. Updates list item in “Manual Upload List”
    Can someone suggest a different design approach that can manage the large file outside of SharePoint context? Something like
       1. Some option to initiate file copy from user local machine to UNC path when he submits the layouts page
       2. Instead of timer jobs, have external services that grab data from a UNC path and processes periodic intervals to push it into SharePoint.

    Hi,
    According to your post, my understanding is that you want to upload and process files for SharePoint 2013 server.
    The following suggestion for your reference:
    1.We can create a service to process the upload file and copy the files to the UNC folder.
    2.Create a upload file visual web part and call the process file service.
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Problem while uploading data from flat file

    hi friends,
    suppose if there are 100 records in flat file , if 20 records uploaded with out any problem and if error occurs while uploading remaing data . is necessary to upload entire data again or else only remaining data should be uploaded?
    i had used call transaction for purchase order application?
    please give me reply  soon its urgent
    thanks & regards
    priya

    Hi Hari,
    you have to upload the remaining data.
    as u have used CT method, do 1 thing trap the error data in runtime & prepare another flat file. next time correct the data in new flat file. & run the DBC program again with this new flat file.
    Reward if useful
    Regards
    ANUPAM

  • Change Value While Uploading data From Excel File

    Dear Expert,
    Please guide me is it Possible?, if yes then How?
    We have one BDC Uploader there After uploading data from Excel File, i want to check one field like this....
    if it_f65data-newbs contains any Alphabet.
    then user Should be able to change value on the same time while executing Program in table.
    Please tell me how i can change value in running program
    Regards'
    Shelly Malik

    Hi,
    What you can probably do is, perform a consistency check on your data in the internal table and segregate all those rows that have inconsistent data (in your case, the field NEWBS containing albhabets) into another temporary internal table. Display the temporary internal table in an editable ALV grid saying that these data have not been inserted to the database, coz they have inconsistent data in the field NEWBS. Allow the user to edit and then save the data which will consequently refresh the internal table contents.

Maybe you are looking for