Large images --java.lang.OutOfMemoryError browser

Hello,
i am loading a tif file of 174MB into an signed applet.Problem is its not loading very large images in browser,but works fine in appletviewer(1 min) bcus(if i am correct) appletviewer use more JVM memory and i think browsers JVM use 16mb(whihc is not sufficient for loading large images) ,but i increased memory,still its not loading.Anybody has any solution for this,please help me
thanks
hithesh

Hi Everyone.
i forced my java console which is used by both IE and NN to use 256m
like -Xmx256m.now its loading large images of 175MB.
but any of u guys know how to force it in applet code,so that user who is using my applet doesnt have to bother about doing it?
thanks
Hithesh Gazzala

Similar Messages

  • Error  in PI mapping "nested exception is: java.lang.OutOfMemoryError "

    Hi Experts ,
    I encounter an error in the PI mapping while calling a Java Mapping (Mercator Map)
    Error Message as ::-
    java.lang.RuntimeException: RemoteException in setMercGeneral: Error occurred in server thread; nested exception is: java.lang.OutOfMemoryError at com.philips.xi.mercator.MercatorCall.execute(MercatorCall.java:90) at
    Could anyone suggest , how we can overcome  this error message
    I have  also tried  to restart the  RMI Server , but that was not not helpful.
    Regards,
    Shweta

    Sweta,
    Is this a java mapping or Graphical, If Java, you should not run into this issue as you dont load the nested XSD`s.
    Also the error message indicates outofMemory in mercator side when posting your Large message.
    java.lang.OutOfMemoryError at com.philips.xi.mercator.MercatorCall.execute(MercatorCall.java:90) at
    Regards
    Ravi Raman
    Edited by: Ravi Raman on Jun 30, 2010 4:26 PM

  • Java.lang.OutOfMemoryError: allocLargeObjectOrArray error for large payload

    Our is an outbound flow where one FTP adapter picks the files and it calls a requester service, requester service calls the EBS and EBS calls the provider service, and finally file is getting written using the B2B.
    Since last 4/5 days we are getting java.lang.OutOfMemoryError: allocLargeObjectOrArray.
    We are getting this error when large payloads are being used for doing testing.
    As per our understanding, when you have a tree of composite invocations (so A invokes B invokes C invokes D via flowN 100 times), none of the memory is released until they all complete.
    1. Could you please let us know exactly when memory is released?
    2. How to tune/optimize this?
    Our flow is like:
    SyncDisbursePaymentGetFtpAdapter --> CreateDisbursedPaymentEbizReqABCSImp l--> SyncDisbursePaymentRBTTEBS --> SyncDisbursedPaymentJPMC_CHKProvABCSImpl--> AIAB2BInterface --> Oracle B2B
    <Dec 12, 2012 8:17:06 PM EST> <Warning> <RMI> <BEA-080003> <RuntimeException thrown by rmi server: javax.management.remote.rmi.RMIConnecti\
    onImpl.invoke(Ljavax.management.ObjectName;Ljava.lang.String;Ljava.rmi.MarshalledObject;[Ljava.lang.String;Ljavax.security.auth.Subject;)
    javax.management.RuntimeErrorException: java.lang.OutOfMemoryError: allocLargeObjectOrArray: [B, size 667664.
    javax.management.RuntimeErrorException: java.lang.OutOfMemoryError: allocLargeObjectOrArray: [B, size 667664
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:858)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:869)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:838)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
    at weblogic.management.jmx.mbeanserver.WLSMBeanServerInterceptorBase$16.run(WLSMBeanServerInterceptorBase.java:449)
    Truncated. see log file for complete stacktrace
    Caused By: java.lang.OutOfMemoryError: allocLargeObjectOrArray: [B, size 667664
    at java.util.Arrays.copyOf(Arrays.java:2786)
    at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
    at java.io.ObjectOutputStream$BlockDataOutputStream.drain(ObjectOutputStream.java:1847)
    at java.io.ObjectOutputStream$BlockDataOutputStream.setBlockDataMode(ObjectOutputStream.java:1756)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1169)
    Truncated. see log file for complete stacktrace
    Do any one have any idea how to rectify this error as whole UAT environment has become down because of this issue.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Please find the required info:
    1. Operating System--> LINUX
    2. JVM (Sun or JRockit)-->JRockit
    3. Domain info (production mode enabled?, log levels, number of servers in cluster, number of servers in a machine)-->
    a) production mode enabled-->>Production mode is not enabled, we are going to enable it.
    b)Log levels---There are many logs b2b, soa, bpel, integration, which log level do I need to do finest(32).
    c) number of servers in cluster-->2
    d) number of servers in a machine-->1
    3. Payload info (size, xml/non-xml?,)
    a) size-->more than 1 MB, and upto 25 MB
    b)xml/non-xm--> xml
    we are trying to do the changes as suggested by you and will update accordingly.

  • Binary conversion of a big image leads to "java.lang.OutOfMemoryError"?

    Hi,
    My program loads a black and white 1 bit depth image of around 20 - 30mb. When I try to convert it to binary image, it gives the following error: java.lang.OutOfMemoryError: Java heap spaceI am converting a bufferedimage to binaryimage. I used the following conversion method:      
    // This method converts an image to a binary image:
         public static BufferedImage convert (BufferedImage src, int type)
              int w = src.getWidth ();
              int h = src.getHeight ();
              BufferedImage dst = new BufferedImage (w, h, type);
            Graphics2D g = dst.createGraphics ();
            g.drawRenderedImage (src, null);
            g.dispose ();
              return dst;
         }The program was working well before but now it keeps giving the heap memory error which is really weird. Is there any way I can fix this? Can anybody suggest a better way to convert a black and white image to binary data. Thanks.

    You could increase maximum memory (-Xmx): [http://java.sun.com/javase/6/docs/technotes/tools/windows/java.html]

  • Java.lang.OutOfMemoryError during transfer of large data from SAP to PI

    Hi experts,
    We are trying to transfer large data from SAP to external system via PI but the transfer stucked in sm58 of SAP system with 'error java.lang.OutOfMemoryError'. We have tested before this and we can only get approximately 100K of records to go through successfully. We neeed approximately transfer 300k datas per time. Current setting of max heap size (in mb) of our PI system is 512 at message server and bootstap tab. At servers general tab the max heap size (in mb) is 2048 and its java parameters are having the values below:
    -Xmx1024m
    -Xms1024m
    -Djco.jarm=1
    -XX:PermSize=512m
    -XX:MaxPermSize=512m
    -XX:NewSize=320m
    -XX:MaxNewSize=320m
    What need to be increased to solve the error?
    Thanks.
    Regards,
    Thava

    Hi Thava,
    We can set a limit on the request body message length that can be accepted by the HTTP Provider Service on the Java dispatcher. The system controls this limit by inspecting the Content-Length header of the request or monitoring the chunked request body (in case chunked encoding is applied to the message). If the value of the Content-Length header exceeds the maximum request body length, then the HTTP Provider Service will reject the request with a 413 u201CRequest Entity Too Largeu201D error response. You can limit the length of the request body using the tting MaxRequestContentLength property of the HTTP Provider Service running on the Java dispatcher. By default, the maximum permitted value is 131072 KB (or 128MB).You can configure the MaxRequestContentLength property using the Visual Administrator tool. Proceed as follows:
           1.      Go to the Properties tab of the HTTP Provider Service running on the dispatcher.
           2.      Choose MaxRequestContentLength property and enter a value in the Value field. The length is specified in KB.
           3.      Choose Update to add it to the list of properties.
           4.      To apply these changes, choose  (Save Properties).
    The value of the parameter MaxRequestContentLength has to be set to a high value.
    In short parameters to reset values for ABAP side are
    icm/HTTP/max_request_size_KB
    icm/server_port_ TIMEOUT
    rdisp/max_wprun_time
    zttp/max_memreq_MB
    Parameter to reset values for JAVA side is MaxRequestContentLength.
    You can use following link to know more about ICM parameters
    http://help.sap.com/saphelp_nw04/helpdata/EN/61/f5183a3bef2669e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/EN/25/b0a4f6f2b03a43a727a165a4d6a555/frameset.htm
    regards
    Anupam

  • Large insert and java.lang.OutOfMemoryError

    Hello.
    I have an application that is trying to insert a large amount of data into the database (could be 200,000 rows). We are getting a java.lang.OutOfMemoryError in the process of doing the insert. The inserts are currently being done by looping over a Vector where each element in the Vector contains an id that is needed to do each insert. Actually, the Vector contains instances of DatabaseRow from a previous query done using "executingSelectingCall()". For each DatabaseRow in the Vector, a row is added to another table in the database:
    for(int i=0; i<trackingSelectRes.size(); i++)
    DatabaseRow dbRow = (DatabaseRow)trackingSelectRes.get(i);
                                  BigDecimal recordId = (BigDecimal)dbRow.get(PREMIUM_PK_IN_TMP_TABLE);
                                  trackingUpdateSql.setSQLString("INSERT INTO " + trackingTableName + " (" + PK_IN_TRACKING + ", " + PREMIUM_PK_IN_TRACKING + ", " + BMTID + ", " + RULEID + ", " + TIMESTAMP + ") " + "VALUES" +
                                                                          " ("+ TRACKING_PK_SEQ + ".nextval, " + recordId.longValue() + ", '" + rule.getBmtId().getBmtId() + "', '" + rule.getRuleId() + "', sysdate)");
                                  //System.out.println("TRACKING PREMIUM INSERT STATEMENT: " + trackingUpdateSql.getSQLString());
                                  session.executeNonSelectingCall(trackingUpdateSql);
    My first thought is to do a ReportQuery to get the ids that are needed to do the insert instead of loading all of the rows that contain the ids into memory. But, I'm also thinking that we are taking the incorrect approach to the problem. I looked at TopLink's batch writing, but I don't want to create objects for this data. Does TopLink have another way of doing a mass insert or would it be better to use a stored procedure?
    Thanks,
    Katie

    Thanks for your reply. I have another quick question? Could I get a UnitOfWork and call executeNonSelectingCall() with calls to commitAndResume() at a predetermined interval? Would that allow me to not have to commit every row?
    Thanks,
    Katie

  • Error "java.lang.OutOfMemoryError" When Returning Large Number of Docs

    In our SES implementation, we have a custom search interface that allows users to search for documents and then add them to a "shopping cart". Users add then to their shopping cart from search results, by adding docs one-by-one or an Add All option. Once they are done "shopping" they create a report.
    Here is the scenario...
    Users are saerching for documents and seeing that on page 1, there is 1 - 10 of about 300 results. They clicked Add All and want all 300 docs added to their cart.
    What we do under the covers is we execute another search and set the docs requested to 200. We get the array of docs, iterate over them and add the keys to a list. We found 200 docs at a time to be a safe number. However, there are still 100 docs that were not added to their cart and users want all 300 added. In other words, when they click Add All, they want to add all docs, 300, 500, 5000, etc.
    I set the "Maximum Number of Results" to 500 and found that I can safely add up to ~ 350 docs at one time. However, going past this point throws the following error:
    [SOAPException: faultCode=SOAP-ENV:Server; msg= [java.lang.OutOfMemoryError]]
         at oracle.search.query.webservice.client.OracleSearchService.makeSOAPCallRPC(OracleSearchService.java:941)
         at oracle.search.query.webservice.client.OracleSearchService.doOracleSearch(OracleSearchService.java:469)
    After this error is thrown, SES was unable to recover and searching would not work anymore, even return 10 docs at a time. We had to restart SES to resolve the issue.
    1. What is throwing this error? Is it the amount of XML being returned?
    2. What is the maximum number of results we can get back at any one time? Is it based on the amount of data being returned or the number of attributes?
    We are running 10.1.8 with plans to upgrade soon.
    Thanks in advance.

    I know it may be hard to throw away all this code, but consider using the jakarta fileupload component.
    I think it would simplify your code down to
    // Create a factory for disk-based file items
    FileItemFactory factory = new DiskFileItemFactory();
    // Create a new file upload handler
    ServletFileUpload upload = new ServletFileUpload(factory);
    // Parse the request
    List /* FileItem */ items = upload.parseRequest(request);
    // Process the uploaded items
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
        FileItem item = (FileItem) iter.next();
        if (item.isFormField()) {
            processFormField(item);
        } else {
            // item is a file.  write it
            File saveFolder = application.getRealPath("/file");          
            File uploadedFile = new File(saveFolder, item.getName());
            item.write(uploadedFile);
    }Most of this code was hijacked from http://jakarta.apache.org/commons/fileupload/using.html
    Check it out. It will solve your memory problem by writing the file to disk temporarily if necessary.
    Cheers,
    evnafets

  • Trouble with  "java.lang.OutOfMemoryError: Java heap space"

    Hello,
    I use a Java-based modeling tool that very few out there are probably familiar with. This tool allows me to run models (program) from within the development environment, to create Applets or create jar files that can be executed in a stand-alone fashion.
    I am using a database on my local harddrive to read in some data using JDBC, so am not using the Applet option with certificates. The development environment is expensive, so can't be distributed. That leaves the stand-alone option.
    The model (program) I've written runs perfectly fine in the development environment and, previously, has worked fine as a stand-alone program. However, the stand-alone option isn't working anymore, because I keep getting this error.
    I am not much of a Java programmer; I'm learning as I go along. If anyone can help me solve this, I'll be most appreciative
    From my cmd prompt:
    C:\Documents and Settings\072\Desktop\TA\for\for Applet Files>cd "C:\D
    ocuments and Settings\072\Desktop\TA\for\for Applet Files"
    C:\Documents and Settings\072\Desktop\TA\for\for Applet Files>java -cl
    asspath enterprise_library.jar;business_graphics_library.jar;for.jar;xjanylog
    ic5engine.jar for/Main$Simulation
    Started...
    AnyLogic simulation engine has started [$Id: Engine.java,v 1.134 2004/12/03 08:4
    9:39 basil Exp $]
    java.lang.OutOfMemoryError: Java heap space
    setting error: Exception during root.courseQueue-1556 startup: java.lang.OutOfMe
    moryError: Java heap space
    thread = Thread[Model Creation Thread,5,main]
    engine = com.xj.anylogic.Engine@1099257
    Exception in thread "Image Fetcher 0" java.lang.OutOfMemoryError: Java heap spac
    e
    java.lang.OutOfMemoryError: Java heap space
    setting error: Exception during startup: java.lang.OutOfMemoryError: Java heap s
    pace
    thread = Thread[Model Creation Thread,5,main]
    engine = com.xj.anylogic.Engine@1099257
    java.lang.OutOfMemoryError: Java heap space
    setting error: Exception in statechart 'root.courseExit-0.inputProcessor' entry
    actions: java.lang.OutOfMemoryError: Java heap space
    thread = Thread[AnyLogic main thread,5,main]
    engine = com.xj.anylogic.Engine@1099257
    java.lang.OutOfMemoryError: Java heap space
    setting error: Exception in statechart 'root.courseDelay-0.inputProcessor' entry
    actions: java.lang.OutOfMemoryError: Java heap space
    thread = Thread[AnyLogic main thread,5,main]
    engine = com.xj.anylogic.Engine@1099257
    java.lang.OutOfMemoryError: Java heap space
    setting error: Exception in statechart 'root.courseDelay-1.inputProcessor' entry
    actions: java.lang.OutOfMemoryError: Java heap space
    thread = Thread[AnyLogic main thread,5,main]Exception in thread "AWT-EventQueu
    e-0"
    java.lang.OutOfMemoryError: Java heap space
    engine = com.xj.anylogic.Engine@1099257

    Hi I am ancountering the same problem with the 'heap space'.
    Is there any way I can find out what it is set to for my system? I dont believe its 32Mb and dont want to increase it randomly to too large a size if theres no need for it.
    Thanks,
    Bobby

  • ! java.lang.OutOfMemoryError in 8.1.6.3.0 !

    Today I have installed path 8.1.6.3.0 on my 8.1.6.0.0 OracleEE (Sun Solaris8 x86). Before that action my JServer work correctly, but after this patch JServer was down. It cannot process any action (loadjava, sess_sh and so on) and always generate the java.lang.OutOfMemoryError or java.lang.NegativeArraySizeException!!!
    What is the problem?
    the trace file:
    Dump file /oracle/app/oracle/admin/PHNET3/bdump/s000_18344.trc
    Oracle8i Enterprise Edition Release 8.1.6.3.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.3.0 - Production
    ORACLE_HOME = /oracle/app/oracle/product/8.1.5
    System name: SunOS
    Node name: phnet3
    Release: 5.8
    Version: Generic
    Machine: i86pc
    Instance name: PHNET3
    Redo thread mounted by this instance: 1
    Oracle process number: 11
    Unix process pid: 18344, image: oracle@phnet3 (S000)
    *** 2001-06-18 10:08:46.137
    *** SESSION ID:(17.1876) 2001-06-18 10:08:46.124
    java.lang.OutOfMemoryError
    at oracle.aurora.rdbms.security.SchemaProtectionDomain.fabricateAccessContext(SchemaProtectionDomain.java)
    at java.security.AccessController.getStackAccessControlContext(AccessController.java)
    at java.security.AccessController.checkPermission(AccessController.java)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java)
    at oracle.aurora.rdbms.SecurityManagerImpl.checkPermission(SecurityManagerImpl.java)
    at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java)
    at oracle.aurora.rdbms.SecurityManagerImpl.checkPropertyAccess(SecurityManagerImpl.java)
    at java.lang.System.getProperty(System.java)
    at oracle.aurora.rdbms.Compiler.setMemory(Compiler.java)
    at oracle.aurora.rdbms.Compiler.doCompile(Compiler.java)
    at oracle.aurora.rdbms.Compiler.compile(Compiler.java)
    java.lang.OutOfMemoryError
    at oracle.aurora.rdbms.security.SchemaProtectionDomain.fabricateAccessContext(SchemaProtectionDomain.java)
    at java.security.AccessController.getStackAccessControlContext(AccessController.java)
    at java.security.AccessController.checkPermission(AccessController.java)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java)
    at oracle.aurora.rdbms.SecurityManagerImpl.checkPermission(SecurityManagerImpl.java)
    at oracle.aurora.security.JServerPermission.check(JServerPermission.java)
    at oracle.aurora.vm.OracleRuntime.setMaxMemorySize(OracleRuntime.java)
    at oracle.aurora.rdbms.Compiler$1.run(Compiler.java)
    at java.security.AccessController.doPrivileged(AccessController.java)
    at oracle.aurora.rdbms.Compiler.setMemory(Compiler.java)
    at oracle.aurora.rdbms.Compiler.setNumberOfClassesResolved(Compiler.java)
    *** 2001-06-18 10:36:52.247
    *** SESSION ID:(15.1950) 2001-06-18 10:36:52.247
    java.lang.OutOfMemoryError
    at oracle.aurora.rdbms.security.SchemaProtectionDomain.fabricateAccessContext(SchemaProtectionDomain.java)
    at java.security.AccessController.getStackAccessControlContext(AccessController.java)
    at java.security.AccessController.checkPermission(AccessController.java)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java)
    at oracle.aurora.rdbms.SecurityManagerImpl.checkPermission(SecurityManagerImpl.java)
    at oracle.aurora.security.JServerPermission.check(JServerPermission.java)
    at oracle.aurora.vm.OracleRuntime.setMaxMemorySize(OracleRuntime.java)
    at oracle.aurora.rdbms.Compiler$1.run(Compiler.java)
    at java.security.AccessController.doPrivileged(AccessController.java)
    at oracle.aurora.rdbms.Compiler.setMemory(Compiler.java)
    at oracle.aurora.rdbms.Compiler.doCompile(Compiler.java)
    at oracle.aurora.rdbms.Compiler.compile(Compiler.java)
    java.lang.OutOfMemoryError
    at oracle.aurora.rdbms.security.SchemaProtectionDomain.fabricateAccessContext(SchemaProtectionDomain.java)
    at java.security.AccessController.getStackAccessControlContext(AccessController.java)
    at java.security.AccessController.checkPermission(AccessController.java)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java)
    at oracle.aurora.rdbms.SecurityManagerImpl.checkPermission(SecurityManagerImpl.java)
    at oracle.aurora.security.JServerPermission.check(JServerPermission.java)
    at oracle.aurora.vm.OracleRuntime.setMaxMemorySize(OracleRuntime.java)
    at oracle.aurora.rdbms.Compiler$1.run(Compiler.java)
    at java.security.AccessController.doPrivileged(AccessController.java)
    at oracle.aurora.rdbms.Compiler.setMemory(Compiler.java)
    at oracle.aurora.rdbms.Compiler.setNumberOfClassesResolved(Compiler.java)
    P.S.: I try to reinstall JServer usinf javavm/insatall scripts. But the errors still occur.
    null

    I am having similar problems.
    ** 2001-08-09 09:29:09.772
    ** SESSION ID:(13.67) 2001-08-09 09:29:09.772
    ox_call_java_pres_: caught
    RA-04031: unable to allocate 4032 bytes of shared memory ("large
    pool","unknown object","joxu heap init","ioc_allocate_pal")
    I edited the init.ora in $ORACLE_HOME/dbs/ and changed or added the line:
    shared_pool_size=100000000
    java_pool_size=70000000
    I added java_pool_size line because there was no line like that in the typical install of oracle8.1.7 on solaris.
    Then, I used dbshut to shut down all the oracle processes. I also used the listener ctl program in $ORACLE_HOME/bin to stop the listener. Then, I ran dbstart.
    That should re-initialize oracle and the jserver should use the settings in init.ora, right?
    But when I run an entity bean program, i still get the same error (at the top of this message). I get similar problems when I run the basic or entity (customer) demo.
    Am I doing something wrong?
    null

  • Java outputstream java.lang.OutOfMemoryError: Java heap space

    Hi All,
    I am trying to publish a large video/image file from the local file system to an http path, but I run into an out of memory error after some time...
    here is the code
    public boolean publishFile(URI publishTo, String localPath) throws Exception {
            InputStream istream = null;
            OutputStream ostream = null;
            boolean isPublishSuccess = false;
            URL url = makeURL(publishTo.getHost(), this.port, publishTo.getPath());
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            if (conn != null) {
                try {
                    conn.setDoOutput(true);
                    conn.setDoInput(true);
                    conn.setRequestMethod("PUT");
                    istream = new FileInputStream(localPath);
                    ostream = conn.getOutputStream();
                    int n;
                    byte[] buf = new byte[4096];
                    while ((n = istream.read(buf, 0, buf.length)) > 0) {
                        ostream.write(buf, 0, n); //<--- ERROR happens on this line.......???
                    int rc = conn.getResponseCode();
                    if (rc == 201) {
                        isPublishSuccess = true;
                } catch (Exception ex) {
                    log.error(ex);
                } finally {
                    if (ostream != null) {
                        ostream.close();
                    if (istream != null) {
                        istream.close();
            return isPublishSuccess;
        }HEre is the error i am getting...
    Exception in thread "Thread-8773" java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2786)
            at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
            at sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)
            at com.test.HTTPClient.publishFile(HTTPClient.java:110)
            at com.test.HttpFileTransport.put(HttpFileTransport.java:97)Edited by: ashchawla on Jan 17, 2010 9:21 AM

    It seems that the HttpURLConnection tries to buffer all the data you want to send and doesn't stream the data as it comes.
    This means that you will need at least as much memory as the size of your file (more likely you'll need quite a bit more). This is definitely not ideal for sending huge files, so you might want to look at other HTTP clients, if they are better at handling huge files.
    Try the Apache Commons HTTPClient. I've heard good things about it.
    Thanks for crossposting. You will not get any more help from me. Not here, not on SO.

  • PaintComponent()  and jave.lang.OutOfMemoryError problem

    I have a paintComponent() method that in it , I paint the GraphicsContexts with a big BufferedImage
    here is the code:
    void doPaint(){ //do some painting on the buffer
    buffer = new BufferedImage(waveForm.viewPortDim.width,waveForm.viewPortDim.height,
    BufferedImage.TYPE_4BYTE_ABGR_PRE);
    waveForm.xPanel.paintEcgBuffer(buffer);
    public void paintComponent(Graphics g){
    //super.paintComponent(g);//??
    Graphics2D g2 = (Graphics2D)g;
    try{            
    g2.drawImage(buffer,0,0,this);
    }catch(OutOfMemoryError e){
    e.printStackTrace();
    System.out.println("error "+e.getMessage());
    I use doPaint() to do some painting over the buffer but i get jave.lang.OutOfMemoryError when i try to do
    g2.drawImage(buffer,0,0,this);
    Is there a limit on the height or width of the GraphicsContexts?
    The dimension of the bufeer can be about 1400x2800 or 1400x5500.
    What can I do?
    Thank you in advance.
    Yair.

    I don't know the answer to this question, but it may help you out to examine it.
    Is it possible that your graphics card is running out of the memory to display this large image?
    You may want to just display what the screen is displaying, so clip the rest beforehand, which would lead to a smaller buffered image.

  • Serious system error while executing the query: java.lang.OutOfMemoryError

    From ALSB, we are trying to insert records in a table, by calling the ALDSP webservice. It is working fine when the xml (ie., given as input to the ALDSP webservice) is small. But facing the following error when the input xml size is large.
    <ALDSP> <BEA-000000> <Product> <Serious system error while executing the query:
    {ld:ABC/Test}createTest:1
    java.lang.OutOfMemoryError: Java heap space
    We do not want to increase the heap size. Is there any other way we can solve this problem?

    In logical dataservice of ALDSP we have created a procedure called createTest, which is used to insert mulitple rows in the table. We have created a webservice for that logical DataService.
    Using the ALSB, we are calling the webservice -> createTest Operation and we are passing xml as input to that createTest function.
    Input xml:
    <ns1:createTest>
    <ns1:createTemps>
    <ns0:createTemp>
         <ns0:field1>1</ns0:field1>
              <ns0:field10>test1</ns0:field10>
    </ns0:createTemp>                
    <ns0:createTemp>
         <ns0:field1>2</ns0:field1>
              <ns0:field10>test2</ns0:field10>
    </ns0:createTemp>
         </ns1:createTemps>     
    </ns1:createTest>
    each ns0:createTemp represent a row that need to be inserted in the table.
    When the number of ns0:createTemp is less ( when the number of rows that need to be inserted is less) then no problem occurs, it is getting inserted properly. But when there are more number of ns0:createTemp then we are getting the following error
    <ALDSP> <BEA-000000> <Product> <Serious system error while executing the query:
    {ld:ABC/Test}createTest:1
    java.lang.OutOfMemoryError: Java heap space

  • FB 4.7 AIR 3.6 Flex 4.9 iOS packing - Exception in thread "main" java.lang.OutOfMemoryError'

    I've got an error similar to Isaac_Sunkes' 'FB 4.7 iOS packaging - Exception in thread "main" java.lang.OutOfMemoryError',
    but the causes are not related to what he discovered, corrupt image or other files, I'd exclude bad archive contents in my project.
    I'm using Flash Builder 4.7 with Adobe AIR 3.6 set into an Apache Flex 4.9.1 SDK;
    HW system is:
    iMac,    2,7 GHz Intel Core i5,    8 GB 1600 MHz DDR3,    NVIDIA GeForce GT 640M 512 MB,    OS X 10.8.2 (12C3103)
    The Flash project consists in an application with a main SWF file which loads, via ActionScript methods, other SWF in cascade.
    I've formerly compiled and run the application on an iPad 1, IOS 5.0.1 (9A405), but got on the device the error alert:
    "Uncompiled ActionScript
    Your application is attempitng to run
    uncompiled ActionScript, probably
    due to the use of an embedded
    SWF. This is unsupported on iOS.
    See the Adobe Developer
    Connection website for more info."
    Then I changed the FB compiler switches, now are set to:
    -locale en_US
    -swf-version=19
    Please note that without the switch    -swf-version=19     the application is compiled correctly and the IPA is sent to the device
    and I can debug it, but iOS traps secondary SWF files and blocke the app usage, as previously told.
    they work on deploy of small applications,
    but, when I try to build a big IPA file either for an ad-hoc distribution, either for an debug on device, after some minutes long waiting, I get a Java stuck, with this trace:
    Error occurred while packaging the application:
    Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at java.util.HashMap.addEntry(HashMap.java:753)
        at java.util.HashMap.put(HashMap.java:385)
        at java.util.HashSet.add(HashSet.java:200)
        at adobe.abc.Algorithms.addUses(Algorithms.java:165)
        at adobe.abc.Algorithms.findUses(Algorithms.java:187)
        at adobe.abc.GlobalOptimizer.sccp(GlobalOptimizer.java:4731)
        at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:3615)
        at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:2309)
        at adobe.abc.LLVMEmitter.optimizeABCs(LLVMEmitter.java:532)
        at adobe.abc.LLVMEmitter.generateBitcode(LLVMEmitter.java:341)
        at com.adobe.air.ipa.AOTCompiler.convertAbcToLlvmBitcodeImpl(AOTCompiler .java:599)
        at com.adobe.air.ipa.BitcodeGenerator.main(BitcodeGenerator.java:104)
    I've tried to change the Java settings on FB's eclipse.ini in MacOS folder,
    -vmargs
    -Xms(various settings up to)1024m
    -Xmx(various settings up to)1024m
    -XX:MaxPermSize=(various settings up to)512m
    -XX:PermSize=(various settings up to)256m
    but results are the same.
    Now settings are back as recommended:
    -vmargs
    -Xms256m
    -Xmx512m
    -XX:MaxPermSize=256m
    -XX:PermSize=64m
    I've changed the Flex build.properties
    jvm.args = ${local.d32} -Xms64m -Xmx1024m -ea -Dapple.awt.UIElement=true
    with no results; now I'n get back to the standard:
    jvm.args = ${local.d32} -Xms64m -Xmx384m -ea -Dapple.awt.UIElement=true
    and now I truely have no more ideas;
    could anyone give an help?
    many thanks in advance.

    I solved this. It turns out the app icons were corrupt. After removing them and replacing them with new files this error went away.

  • Error: java.lang.OutOfMemoryError when uploading CSV files to web server

    Hi experts,
    I have made a JSP page from which clients load csv files to web server. I am using Tomca 4.1 as my web server and JDK 1.3.1_09.
    The system works fine when uploadiing small csv files, but it crashes when uploading large CSV files.
    It gives me the following error:
    java.lang.OutOfMemoryError
         <<no stack trace available>>
    This is the code that I used to load files....
    <%
    String saveFile = "";
    String contentType = request.getContentType();
    if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
         DataInputStream in = new DataInputStream(request.getInputStream());
         int formDataLength = request.getContentLength();
         byte dataBytes[] = new byte[formDataLength];
         int byteRead = 0;
         int totalBytesRead = 0;
         while (totalBytesRead < formDataLength)
              byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
              totalBytesRead += byteRead;
         String file = new String(dataBytes);
         saveFile = file.substring(file.indexOf("filename=\"") + 10);
         saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
         saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\""));
         int lastIndex = contentType.lastIndexOf("=");
         String boundary = contentType.substring(lastIndex + 1,contentType.length());
         int pos;
         pos = file.indexOf("filename=\"");
         pos = file.indexOf("\n", pos) + 1;
         pos = file.indexOf("\n", pos) + 1;
         pos = file.indexOf("\n", pos) + 1;
         int boundaryLocation = file.indexOf(boundary, pos) - 4;
         int startPos = ((file.substring(0, pos)).getBytes()).length;
         int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
         String folder = "f:/Program Files/Apache Group/Tomcat 4.1/webapps/broadcast/file/";
         //String folder = "10.28.12.58/bulksms/";
         FileOutputStream fileOut = new FileOutputStream(folder + saveFile);
         //out.print("Saved here: " + saveFile);
         //fileOut.write(dataBytes);
         fileOut.write(dataBytes, startPos, (endPos - startPos));
         fileOut.flush();
         fileOut.close();
         out.println("File loaded successfully");
    //f:/Program Files/Apache Group/Tomcat 4.1/webapps/sms/file/
    %>
    Please can anyone help me solve this problem for me...
    Thanx...
    Deepak

    I know it may be hard to throw away all this code, but consider using the jakarta fileupload component.
    I think it would simplify your code down to
    // Create a factory for disk-based file items
    FileItemFactory factory = new DiskFileItemFactory();
    // Create a new file upload handler
    ServletFileUpload upload = new ServletFileUpload(factory);
    // Parse the request
    List /* FileItem */ items = upload.parseRequest(request);
    // Process the uploaded items
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
        FileItem item = (FileItem) iter.next();
        if (item.isFormField()) {
            processFormField(item);
        } else {
            // item is a file.  write it
            File saveFolder = application.getRealPath("/file");          
            File uploadedFile = new File(saveFolder, item.getName());
            item.write(uploadedFile);
    }Most of this code was hijacked from http://jakarta.apache.org/commons/fileupload/using.html
    Check it out. It will solve your memory problem by writing the file to disk temporarily if necessary.
    Cheers,
    evnafets

  • Java.lang.OutOfMemoryError  at sun.misc.Unsafe.allocateMemory(Native Metho

    Hi All,
    I have noticed the below OOM exception in one of my TCP Node. This OOM didn't cause the JVM to crash. The JVM seems to be running and The node seems to be part of the Cluster. However this TCP node is not receiving and request and not logging anything since the error.
    Has anyone experinced this exception/behaviour with JVM/coherence ?
    Regards
    S
    An exception occ
    urred while encoding a Response for Service=Proxy:ExendTcpProxyService:TcpAcceptor: java.lang.OutOfMemoryError
    at sun.misc.Unsafe.allocateMemory(Native Method)
    at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:99)
    at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.peer.acceptor.TcpAcceptor$BufferPool.instantiateResource(TcpAcceptor.CDB:8)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.peer.acceptor.TcpAcceptor$BufferPool.acquire(TcpAcceptor.CDB:25)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.peer.acceptor.TcpAcceptor$BufferPool.allocate(TcpAcceptor.CDB:3)
    at com.tangosol.io.MultiBufferWriteBuffer.advance(MultiBufferWriteBuffer.java:903)
    at com.tangosol.io.MultiBufferWriteBuffer.write(MultiBufferWriteBuffer.java:311)
    at com.tangosol.io.AbstractWriteBuffer.write(AbstractWriteBuffer.java:110)
    at com.tangosol.io.AbstractWriteBuffer$AbstractBufferOutput.writeBuffer(AbstractWriteBuffer.java:1276)
    at com.tangosol.io.MultiBufferWriteBuffer$MultiBufferOutput.writeBuffer(MultiBufferWriteBuffer.java:648)
    at com.tangosol.io.pof.WritingPofHandler.onOctetString(WritingPofHandler.java:637)
    at com.tangosol.io.pof.PofBufferWriter.writeBinary(PofBufferWriter.java:602)
    at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1329)
    at com.tangosol.io.pof.PofBufferWriter$UserTypeWriter.writeObject(PofBufferWriter.java:2092)
    at com.tangosol.io.pof.PofBufferWriter.writeMap(PofBufferWriter.java:1739)
    at com.tangosol.io.pof.PofBufferWriter.writeObject(PofBufferWriter.java:1421)
    at com.tangosol.io.pof.PofBufferWriter$UserTypeWriter.writeObject(PofBufferWriter.java:2092)
    at com.tangosol.coherence.component.net.extend.message.Response.writeExternal(Response.CDB:15)
    at com.tangosol.coherence.component.net.extend.Codec.encode(Codec.CDB:23)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.encodeMessage(Peer.CDB:23)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.peer.acceptor.TcpAcceptor.encodeMessage(TcpAcceptor.CDB:8)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.send(Peer.CDB:16)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer.post(Peer.CDB:23)
    at com.tangosol.coherence.component.net.extend.Channel.post(Channel.CDB:25)
    at com.tangosol.coherence.component.net.extend.Channel.send(Channel.CDB:6)
    at com.tangosol.coherence.component.net.extend.Channel.receive(Channel.CDB:55)
    at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Peer$DaemonPool$WrapperTask.run(Peer.CDB:9)
    at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:32)
    at com.tangosol.coherence.component.util.DaemonPool$Daemon.onNotify(DaemonPool.CDB:63)
    at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
    at java.lang.Thread.run(Thread.java:619)

    So there are 2 parallel approaches to tackle this
    1) Try to figure out if your objects being exchanged are large and if there are bursts of traffic. i.e is the size of your nio buffer sufficient to handle your load. If so, check if the node doing the processing is unable to deal with events in a timely manner.
    2) Open a ticket. What I heard from training is that in 3.5 coherence should have started choking traffic to the TCP node once it recognized the nio buffers are approaching capacity. So, this is not working
    Fixing 2 will not solve 1. It will just delay the problem in my opinion.
    Bottom line is that there is too much data backlogging in the buffer, either because of unexpected bursts, or because of large objects or because of slowdown in processing in the node.

Maybe you are looking for

  • Local testing server problem

    I have two small programs to determine if session variables are working. When I test locally, I get a blank page for the second script (readsession.php) When I go live, all works fine. Anybody know what causes this?

  • Solution manager service desk - configuration -pls help

    Hi Forum, I have completed basic configuration of service desk (solution manager 7.1) and able to realize things like create/process/confirm message and email notification after automatic support team determination (which works well based on componen

  • Stacked Bar Chart - Values of the Bar

    Hi, I have a stacked bar chart with columns as "Project Name", Rows as "Stages", and measures as "Cost". I have different stages in the X axis and the Projects are stacked for each stages. When I scroll my mouse over the stacks it shows me the "Cost"

  • OpenDocument problem... Please Help!

    Hi all, I have a problem implementing navigation in a WebI report: the idea is that the user clicks on an hyperlink (opendocument) which re-opens the very same report but at a higher level of detail. The thing is: when I initially run the report and

  • Root repository suddenly gone?

    Hi, OVM 2.2.0 running in a single-server serverpool, that has been running fine for a few months. Then yesterday the server didnt mount /OVS for some reason, and I dont know why. The root SR (also the only sr) is located on a partition (/dev/sda3) on