Out of memory error in java- flex communication using RTMP

We are using flex and java in our application. due to RTMP call to fetch data every 5 seconds. it is hiting database and establishing connection and keeps it open hence this is causing for Out of memory issue. Can come one help on this issue.

You probably want to ask here: http://forums.adobe.com/community/flex

Similar Messages

  • Out of Memory Error in Java Agents running in lotus notes

    I have a java agent running inside lotus notes jvm. It runs fine for some days but after some days start giving out of memory error and terminates.
    I need to restart agent manager in notes to enable java agent running. Is there a way to catch out of memory error so that on its catch i could restart agent manager.
    Regards,
    Saitu

    Dear Peter,
    The agent is written in java and
    I need to know a way to enter catch block of 'OUTOFMEMORYERROR'.
    My whole code is in a try block with two catches, one for outofmemoryerror and another for exception. When outofmemory error occurs control passes to the exception catch and not outofmemoryerror catch.
    Since out of memory is an error and not an exception, is there a way to catch it or run some code when out of memory occurs.
    Regards,
    Saitu

  • Out of Memory Error when Saving SequenceFile generated using API

    I am currently developing an application that creates a SequenceFile using .NET 4.0, C# (2010), Windows 7 Pro x64, Dual Core 2.5 GHz, 3.0Gb Memory.  Using the API EngineClass, I create a complete SequenceFile based on user/file inputs and then save it to disk.  When I'm done, I save using SequenceFile.Save() and then release using ReleaseSequenceFileEx().
    For smaller files, there is no problem.  For larger files, I sporadically get the following error:
    System.Runtime.InteropServices.COMException (0xFFFFBD98): Out of memory.
    When the file does save, it is ~2.8Mb.  Breaking the file up is not an option.  I am not looping, this is one shot.  I've tried shutting down VS2010 and restarting the computer.  It is still inconsistent on saving.
    I also had to set the Embed Interop Types to False per guidance from NI.  They said that it is unstable in 4.0.
    Questions
    1. Is there a file limit size to the Save() API function?
    2. Is there a workaround to using the Save()?
    Best Regards
    Solved!
    Go to Solution.

    I am using C#.NET.  I called them in my save method immediately prior to the actual test save sequence.
    GC.Collect();
    GC.WaitForPendingFinalizers();
    GC.Collect();
    GC.WaitForPendingFinalizers();
    try
           CurrentSequenceFile.Save(outputPath);
           catch (Exceptionerror)
           FireLogEvent(ParserLogType.Parsing_Error, string.Format("{0}", error));
    Factory.TSEngine.ReleaseSequenceFileEx(CurrentSequenceFile, ReleaseSeqFileOptions.ReleaseSeqFile_UnloadFile);
    Hope this helps

  • Out of memory errors

    I'm having problems starting 8i. When started from /etc/rc.d/
    init.d/dbora during bootup or manually by root, I get an out of
    memory error.
    If I start it from the dbadmin user (oracle), I either get the
    same out of memory error, or I end up with several hundred shell
    logins and the database still doesn't respond.
    This is RedHat Linux 6.0, kernel 2.2.5-22smp. Here is a sample of
    what happens when I get the out of memory error:
    Mem: 160448K av, 53488K used, 106960K free, 26264K shrd,
    6532K buff
    Swap: 656360K av, 0K used, 656360K free
    36328K cached
    Oracle Server Manager Release 3.1.5.0.0 - Production
    (c) Copyright 1997, Oracle Corporation. All Rights Reserved.
    Oracle8i Release 8.1.5.0.0 - Production
    With the Java option
    PL/SQL Release 8.1.5.0.0 - Production
    SVRMGR> Connected.
    SVRMGR> ORA-27102: out of memory
    Linux Error: 22: Invalid argument
    SVRMGR>
    Server Manager complete.
    Database "ORCL" warm started.
    null

    It turns out that the problem I was having with a large number of
    shell processes being created was due to the use of oraenv in my
    .bashrc file (so much for following the instructions!) It was
    calling itself recursively until the process limit was reached.
    However, even with this fixed, the out of memory error still
    exists.
    max (guest) wrote:
    : dan....
    : check your init.ora......
    Aside from comments, it has these lines, which were created by
    dbassist:
    db_name = test
    instance_name = ORCL
    service_names = test
    control_files = ("/u02/oradata/test/control01.ctl", "/u02/oradata/
    test/control02.ctl")
    db_block_buffers = 8192
    shared_pool_size = 4194304
    log_checkpoint_interval = 10000
    log_checkpoint_timeout = 1800
    # I reduced processes to see if it would help
    processes = 10
    log_buffer = 163840
    background_dump_dest = /u01/admin/test/bdump
    core_dump_dest = /u01/admin/test/cdump
    user_dump_dest = /u01/admin/test/udump
    db_block_size = 2048
    remote_login_passwordfile = exclusive
    os_authent_prefix = ""
    compatible = "8.1.0"
    : also check ulimit
    Here's ulimit -a:
    core file size (blocks) 1000000
    data seg size (kbytes) unlimited
    file size (blocks) unlimited
    max memory size (kbytes) unlimited
    stack size (kbytes) 8192
    cpu time (seconds) unlimited
    max user processes 256
    pipe size (512 bytes) 8
    open files 1024
    virtual memory (kbytes) 2105343
    Everything looks pretty large to me.
    : Dan Wilga (guest) wrote:
    : : I'm having problems starting 8i. When started from /etc/rc.d/
    : : init.d/dbora during bootup or manually by root, I get an out
    : of
    : : memory error.
    : : If I start it from the dbadmin user (oracle), I either get
    the
    : : same out of memory error, or I end up with several hundred
    : shell
    : : logins and the database still doesn't respond.
    : : This is RedHat Linux 6.0, kernel 2.2.5-22smp. Here is a
    sample
    : of
    : : what happens when I get the out of memory error:
    : : Mem: 160448K av, 53488K used, 106960K free, 26264K shrd,
    : : 6532K buff
    : : Swap: 656360K av, 0K used, 656360K free
    : : 36328K cached
    : : Oracle Server Manager Release 3.1.5.0.0 - Production
    : : (c) Copyright 1997, Oracle Corporation. All Rights Reserved.
    : : Oracle8i Release 8.1.5.0.0 - Production
    : : With the Java option
    : : PL/SQL Release 8.1.5.0.0 - Production
    : : SVRMGR> Connected.
    : : SVRMGR> ORA-27102: out of memory
    : : Linux Error: 22: Invalid argument
    : : SVRMGR>
    : : Server Manager complete.
    : : Database "ORCL" warm started.
    null

  • Out of memory error, Urgent!!!

    Hi All,
    I know there have been a lot of posts for this topic, but none of them seem to address my problem. So please help me out!!! I have written an GUI application that if you open and close for up to certain times, say 10 times, then you will get OOM. I have set the objects to be null when closing the application and called System.gc() as well as System.runFinalization(). Note that I can't call System.exit(0) since this application is not a standalone one. I thought in java if the objects are not used any more, then they will be garbage collected. I may not even have to set the objects to be null. But obviously there are still references to these objects in memory.
    I am really frastrated. I read about SoftReference, but I don't get the error while running the application. So I don't think it's very useful for my case.
    hhh

    >
    You probably still have references to the objects
    somewhere.
    The variables you've set to null, aren't the only
    references.
    Is there a way that I can find out what referencesare
    still alive after I exit the application?
    After you exit the application? After you exit
    the application, there are zero references, and also
    it's impossible to get out of memory errors from java
    after it exits.
    But I think you may be using the word "application" or
    "exit" incorrectly here...
    What do you mean you don't get the error whenrunning
    the application?I meant I don't get OOM error while running
    application. I simply launch the application andthen
    exit it. By doing so for about 10 times, then I get
    the OOM error. But that's impossible. After the JVM exits, the JVM
    can't throw an out of memory error. It can't throw
    any errors. It's not running anymore.As I said in my original message, my application is not a standalone one. It is actually one of the tools out of the main application. That's why when I exit this tool I can't use System.exit(0) to stop JVM.

  • Indesign cs5 'out of memory' error when using preflight

    I have been regulary getting an 'out of memory' error when i choose to use my bespoke preflight profile.
    I have 4gig of ram and run Indesign CS5 on OS 10.6.8.
    Does anyone know a work around?
    As soon as I select from the basic default profile, i get the beach ball from hell for 10mins, then it kindly lets me know that I am out of memory, sends a crash report to Adobe and then asks if I want to relauch. I'm stuck in a vicious circle. I must of sent my 4th crash report now and no feedback from anyone at Adobe.

    I have replaced my preferences, but still the problem persists. I have tried switching my view from typical display to fast display before i selected a profile. I thought this may give me the extra memory I needed to avoid the enevitable crash. I learnt that 2 files were indeed rgb instead of cmyk before it crashed again. So I switched them to cmyk and tried again, selected my bespoke profile, but yet again it crashed. I think the problem lies with the file, not Indesign, as i have tried the same profile on a different file and the program doesn't crash and runs as it should. So if in future I need to use said crashing file again, firstly i will need to try Peter's isolate fix method. Otherwise i'll never be able to progress to successful a pdf.

  • Java.lag out of memory error

    my x2 cannot work with the pdf reader i downloaded from nokia store as there is java.lag out of memory error what should i do

    it is common in most s40 phones.....even my C3 does thesame

  • Out of Memory Error - JBOSS - JRocket

    I continue to see my jrocket/jboss/linux servers crash daily in production for out of memory errors. When we trace back the stack to find a query that does not appear to have nearly enough data to bring the server to an out of memory state. Heap useage pattern does not indicate any leak in the application.
    Using RedHat Linux ES - rel. 4 - Nahant Update 4
    startup with 1536m Xms/x
    Any thoughts or previous expereince. This is a Java application servicing a Flex UI

    Check your Linux kernel version.
    If you have an unpatched Linux kernel, which is not compliant, you will see these errors for all Jrocket.
    The 2,6,9-5 kernel is not compliant without patches, see:
    http://e-docs.bea.com/jrockit/jrdocs/suppPlat/prodsupp.html#wp999048
    excerpt
    The JRockit JDK is supported on the default Linux kernel, which varies with the distribution and architecture. See the Notes field in the Summary of Supported Configurations by Release for details. If you require a different kernel, such as the hugemem kernel, contact Oracle Support for current support status.
    Also, see references to x_86 64bit?
    http://jira.jboss.org/jira/browse/JBPAPP-158
    This is a 32bit ES - rel 4 correct?
    This link also shows a fairly excellent step by step Out of Memory Troubleshooting session.

  • (AIR) out of memory error when building workspace

    Hi,
    I created a very simple AIR project. But during the load the
    workbench gave me out of memory errors.
    Please find below the relevant .log entries.
    Thanks for your help,
    -Rogier
    !SESSION 2007-06-13 14:13:10.241
    eclipse.buildId=unknown
    java.version=1.5.0_11
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
    Command-line arguments: -os win32 -ws win32 -arch x86
    !ENTRY org.eclipse.ui 4 4 2007-06-13 14:13:30.383
    !MESSAGE Invalid Menu Extension (Path is invalid):
    goToResource
    !ENTRY org.eclipse.ui 4 4 2007-06-13 14:13:46.565
    !MESSAGE Invalid Menu Extension (Path is invalid):
    org.eclipse.jdt.ui.actions.GoToPackage
    !ENTRY org.eclipse.ui 4 4 2007-06-13 14:13:46.565
    !MESSAGE Invalid Menu Extension (Path is invalid):
    org.eclipse.jdt.ui.actions.GoToType
    !ENTRY org.eclipse.core.jobs 4 2 2007-06-13 16:29:02.002
    !MESSAGE An internal error occurred during: "Building
    workspace".
    !STACK 0
    java.lang.OutOfMemoryError: PermGen space
    !ENTRY org.eclipse.ui 4 4 2007-06-13 16:29:02.159
    !MESSAGE Unhandled event loop exception
    !ENTRY org.eclipse.ui 4 0 2007-06-13 16:29:02.159
    !MESSAGE PermGen space
    !STACK 0
    java.lang.OutOfMemoryError: PermGen space
    !ENTRY org.eclipse.core.jobs 4 2 2007-06-13 16:29:04.675
    !MESSAGE An internal error occurred during: "Building
    workspace".
    !STACK 0
    java.lang.OutOfMemoryError: PermGen space
    !ENTRY org.eclipse.ui 4 4 2007-06-13 16:29:04.691
    !MESSAGE Unhandled event loop exception
    !ENTRY org.eclipse.ui 4 0 2007-06-13 16:29:04.691
    !MESSAGE PermGen space
    !STACK 0
    java.lang.OutOfMemoryError: PermGen space
    !ENTRY org.eclipse.ui 4 4 2007-06-13 16:29:19.067
    !MESSAGE Unhandled event loop exception
    !ENTRY org.eclipse.ui 4 0 2007-06-13 16:29:19.098
    !MESSAGE Failed to execute runnable
    (java.lang.OutOfMemoryError: PermGen space)
    !STACK 0
    org.eclipse.swt.SWTException: Failed to execute runnable
    (java.lang.OutOfMemoryError: PermGen space)
    at org.eclipse.swt.SWT.error(SWT.java:3374)
    at org.eclipse.swt.SWT.error(SWT.java:3297)
    at
    org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126)
    at
    org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
    at
    org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
    at
    org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
    at org.eclipse.jface.window.Window.open(Window.java:796)
    at
    org.eclipse.ui.internal.ide.dialogs.InternalErrorDialog.open(InternalErrorDialog.java:78)
    at
    org.eclipse.ui.internal.ide.dialogs.InternalErrorDialog.openQuestion(InternalErrorDialog. java:185)
    at
    org.eclipse.ui.internal.ide.IDEExceptionHandler.openQuestionDialog(IDEExceptionHandler.ja va:174)
    at
    org.eclipse.ui.internal.ide.IDEExceptionHandler.handleException(IDEExceptionHandler.java: 100)
    at
    org.eclipse.ui.internal.ide.IDEWorkbenchAdvisor.eventLoopException(IDEWorkbenchAdvisor.ja va:298)
    at
    org.eclipse.ui.internal.ExceptionHandler.handleException(ExceptionHandler.java:62)
    at
    org.eclipse.ui.internal.progress.ErrorNotificationManager$1.run(ErrorNotificationManager. java:82)
    at
    org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at
    org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
    at
    org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
    at
    org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
    at
    org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
    at
    org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
    at
    org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
    at
    org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at
    com.adobe.flexbuilder.standalone.FlexBuilderApplication.run(FlexBuilderApplication.java:1 03)
    at
    org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
    at
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLau ncher.java:92)
    at
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav a:68)
    at
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
    Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
    Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at
    org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
    at org.eclipse.core.launcher.Main.run(Main.java:977)
    at org.eclipse.core.launcher.Main.main(Main.java:952)
    Caused by: java.lang.OutOfMemoryError: PermGen space
    !ENTRY org.eclipse.ui.workbench 4 2 2007-06-13 16:34:11.522
    !MESSAGE Problems occurred when invoking code from plug-in:
    "org.eclipse.ui.workbench".
    !STACK 0
    java.lang.NullPointerException
    at
    org.eclipse.ui.internal.EditorManager.convertToSaveables(EditorManager.java:1336)
    at
    org.eclipse.ui.internal.EditorManager.saveAll(EditorManager.java:1203)
    at
    org.eclipse.ui.internal.Workbench$13.run(Workbench.java:790)
    at
    org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
    at
    org.eclipse.ui.internal.Workbench.saveAllEditors(Workbench.java:738)
    at
    org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:658)
    at
    org.eclipse.ui.internal.Workbench.access$8(Workbench.java:642)
    at
    org.eclipse.ui.internal.Workbench$15.run(Workbench.java:855)
    at
    org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
    at
    org.eclipse.ui.internal.Workbench.close(Workbench.java:853)
    at
    org.eclipse.ui.internal.Workbench.close(Workbench.java:828)
    at
    org.eclipse.ui.internal.Workbench$23.handleEvent(Workbench.java:1848)
    at
    org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at
    org.eclipse.swt.widgets.Display.sendEvent(Display.java:3484)
    at
    org.eclipse.swt.widgets.Display.messageProc(Display.java:2675)
    at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native
    Method)
    at
    org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:1927)
    at
    org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:443)
    at
    org.eclipse.swt.widgets.Control.windowProc(Control.java:3334)
    at
    org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1539)
    at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:1634)
    at
    org.eclipse.swt.widgets.Display.windowProc(Display.java:4025)
    at org.eclipse.swt.internal.win32.OS.PeekMessageW(Native
    Method)
    at
    org.eclipse.swt.internal.win32.OS.PeekMessage(OS.java:2401)
    at
    org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2963)
    at
    org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
    at
    org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
    at
    org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
    at
    org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at
    com.adobe.flexbuilder.standalone.FlexBuilderApplication.run(FlexBuilderApplication.java:1 03)
    at
    org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
    at
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLau ncher.java:92)
    at
    org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav a:68)
    at
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    at
    org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
    Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
    Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at
    org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
    at org.eclipse.core.launcher.Main.run(Main.java:977)
    at org.eclipse.core.launcher.Main.main(Main.java:952)
    !ENTRY org.eclipse.ui 4 4 2007-06-13 16:34:19.959
    !MESSAGE Unhandled event loop exception
    !ENTRY org.eclipse.ui 4 0 2007-06-13 16:34:19.959
    !MESSAGE PermGen space
    !STACK 0
    java.lang.OutOfMemoryError: PermGen space

    Hi Rogier,
    Can you please log it in our new public bug system:
    http://bugs.adobe.com/flex?
    It'd be great if you can provide more info to the bug e.g.
    details of your simple AIR project, platform, FB version (Plugin or
    Standalone).
    thanks,
    Sharon

  • Out of Memory Error While deploying as EAR file

    Hai,
    I was trying to deploy an EAR file of size 63 MB which inturn containing about 60 EJB.jars. No WARs. application.xml has all the entries for the JARs. While I am deploying it is giving Out of Memory Error. Is there any way to tweak this problem. I am using my own hand written java application which uses the SunONE deployment APIs for deployment. Can u please tell how to tackle this problem. I am running my application through a batch file which uses jdk1.4.
    Please help me regarding this issue.

    You can set the initial heap size and maximum heap size for the JVM, either in the app-server admin console, or maybe in one of your scripts. You look-up the syntax!...
    I had this error yesterday. I too had run out of memory (150Mb). You simply need to allocate more to the app-server.

  • Uploading large files from applet to servlet throws out of memory error

    I have a java applet that needs to upload files from a client machine
    to a web server using a servlet. the problem i am having is that in
    the current scheme, files larger than 17-20MB throw an out of memory
    error. is there any way we can get around this problem? i will post
    the client and server side code for reference.
    Client Side Code:
    import java.io.*;
    import java.net.*;
    // this class is a client that enables transfer of files from client
    // to server. This client connects to a servlet running on the server
    // and transmits the file.
    public class fileTransferClient
    private static final String FILENAME_HEADER = "fileName";
    private static final String FILELASTMOD_HEADER = "fileLastMod";
    // this method transfers the prescribed file to the server.
    // if the destination directory is "", it transfers the file to
    "d:\\".
    //11-21-02 Changes : This method now has a new parameter that
    references the item
    //that is being transferred in the import list.
    public static String transferFile(String srcFileName, String
    destFileName,
    String destDir, int itemID)
    if (destDir.equals(""))
    destDir = "E:\\FTP\\incoming\\";
    // get the fully qualified filename and the mere filename.
    String fqfn = srcFileName;
    String fname =
    fqfn.substring(fqfn.lastIndexOf(File.separator)+1);
    try
    //importTable importer = jbInit.getImportTable();
    // create the file to be uploaded and a connection to
    servlet.
    File fileToUpload = new File(fqfn);
    long fileSize = fileToUpload.length();
    // get last mod of this file.
    // The last mod is sent to the servlet as a header.
    long lastMod = fileToUpload.lastModified();
    String strLastMod = String.valueOf(lastMod);
    URL serverURL = new URL(webadminApplet.strServletURL);
    URLConnection serverCon = serverURL.openConnection();
    // a bunch of connection setup related things.
    serverCon.setDoInput(true);
    serverCon.setDoOutput(true);
    // Don't use a cached version of URL connection.
    serverCon.setUseCaches (false);
    serverCon.setDefaultUseCaches (false);
    // set headers and their values.
    serverCon.setRequestProperty("Content-Type",
    "application/octet-stream");
    serverCon.setRequestProperty("Content-Length",
    Long.toString(fileToUpload.length()));
    serverCon.setRequestProperty(FILENAME_HEADER, destDir +
    destFileName);
    serverCon.setRequestProperty(FILELASTMOD_HEADER, strLastMod);
    if (webadminApplet.DEBUG) System.out.println("Connection with
    FTP server established");
    // create file stream and write stream to write file data.
    FileInputStream fis = new FileInputStream(fileToUpload);
    OutputStream os = serverCon.getOutputStream();
    try
    // transfer the file in 4K chunks.
    byte[] buffer = new byte[4096];
    long byteCnt = 0;
    //long percent = 0;
    int newPercent = 0;
    int oldPercent = 0;
    while (true)
    int bytes = fis.read(buffer);
    byteCnt += bytes;
    //11-21-02 :
    //If itemID is greater than -1 this is an import file
    transfer
    //otherwise this is a header graphic file transfer.
    if (itemID > -1)
    newPercent = (int) ((double) byteCnt/ (double)
    fileSize * 100.0);
    int diff = newPercent - oldPercent;
    if (newPercent == 0 || diff >= 20)
    oldPercent = newPercent;
    jbInit.getImportTable().displayFileTransferStatus
    (itemID,
    newPercent);
    if (bytes < 0) break;
    os.write(buffer, 0, bytes);
    os.flush();
    if (webadminApplet.DEBUG) System.out.println("No of bytes
    sent: " + byteCnt);
    finally
    // close related streams.
    os.close();
    fis.close();
    if (webadminApplet.DEBUG) System.out.println("File
    Transmission complete");
    // find out what the servlet has got to say in response.
    BufferedReader reader = new BufferedReader(
    new
    InputStreamReader(serverCon.getInputStream()));
    try
    String line;
    while ((line = reader.readLine()) != null)
    if (webadminApplet.DEBUG) System.out.println(line);
    finally
    // close the reader stream from servlet.
    reader.close();
    } // end of the big try block.
    catch (Exception e)
    System.out.println("Exception during file transfer:\n" + e);
    e.printStackTrace();
    return("FTP failed. See Java Console for Errors.");
    } // end of catch block.
    return("File: " + fname + " successfully transferred.");
    } // end of method transferFile().
    } // end of class fileTransferClient
    Server side code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.net.*;
    // This servlet class acts as an FTP server to enable transfer of
    files
    // from client side.
    public class FtpServerServlet extends HttpServlet
    String ftpDir = "D:\\pub\\FTP\\";
    private static final String FILENAME_HEADER = "fileName";
    private static final String FILELASTMOD_HEADER = "fileLastMod";
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException,
    IOException
    doPost(req, resp);
    public void doPost(HttpServletRequest req, HttpServletResponse
    resp)
    throws ServletException,
    IOException
    // ### for now enable overwrite by default.
    boolean overwrite = true;
    // get the fileName for this transmission.
    String fileName = req.getHeader(FILENAME_HEADER);
    // also get the last mod of this file.
    String strLastMod = req.getHeader(FILELASTMOD_HEADER);
    String message = "Filename: " + fileName + " saved
    successfully.";
    int status = HttpServletResponse.SC_OK;
    System.out.println("fileName from client: " + fileName);
    // if filename is not specified, complain.
    if (fileName == null)
    message = "Filename not specified";
    status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    else
    // open the file stream for the file about to be transferred.
    File uploadedFile = new File(fileName);
    // check if file already exists - and overwrite if necessary.
    if (uploadedFile.exists())
    if (overwrite)
    // delete the file.
    uploadedFile.delete();
    // ensure the directory is writable - and a new file may be
    created.
    if (!uploadedFile.createNewFile())
    message = "Unable to create file on server. FTP failed.";
    status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    else
    // get the necessary streams for file creation.
    FileOutputStream fos = new FileOutputStream(uploadedFile);
    InputStream is = req.getInputStream();
    try
    // create a buffer. 4K!
    byte[] buffer = new byte[4096];
    // read from input stream and write to file stream.
    int byteCnt = 0;
    while (true)
    int bytes = is.read(buffer);
    if (bytes < 0) break;
    byteCnt += bytes;
    // System.out.println(buffer);
    fos.write(buffer, 0, bytes);
    // flush the stream.
    fos.flush();
    } // end of try block.
    finally
    is.close();
    fos.close();
    // set last mod date for this file.
    uploadedFile.setLastModified((new
    Long(strLastMod)).longValue());
    } // end of finally block.
    } // end - the new file may be created on server.
    } // end - we have a valid filename.
    // set response headers.
    resp.setContentType("text/plain");
    resp.setStatus(status);
    if (status != HttpServletResponse.SC_OK)
    getServletContext().log("ERROR: " + message);
    // get output stream.
    PrintWriter out = resp.getWriter();
    out.println(message);
    } // end of doPost().
    } // end of class FtpServerServlet

    OK - the problem you describe is definitely what's giving you grief.
    The workaround is to use a socket connection and send your own request headers, with the content length filled in. You may have to multi-part mime encode the stream on its way out as well (I'm not about that...).
    You can use the following:
    http://porsche.cis.udel.edu:8080/cis479/lectures/slides-04/slide-02.html
    on your server to get a feel for the format that the request headers need to take.
    - Kevin
    I get the out of Memory Error on the client side. I
    was told that this might be a bug in the URLConnection
    class implementation that basically it wont know the
    content length until all the data has been written to
    the output stream, so it uses an in memory buffer to
    store the data which basically causes memory issues..
    do you think there might be a workaround of any kind..
    or maybe a way that the buffer might be flushed after
    a certain size of file has been uploaded.. ?? do you
    have any ideas?

  • JavaScript Out of Memory Error on Portal timeout.

    Hello All,
    I am using jsf and Inline navigation in all our portlets and when user leave the browser idle for portal timeout we have 2 problems. 1: Login portlet shows in that specific portlet. 2: we get a javascript alert saying out of memory at line 40. and the porltet shows error message as "Gateway was not able to access requested content. If the error persists, contact your portal Administrator."
    We are using Plumtree 5.0.4 Java version.
    any help is highly appreciated.
    Thanks
    A.J.

    Both are valid behaviors unfortunately.
    1) login portlet is showing up in specific portlet b/c inline navigation allows for you to create and load pages without affecting the overall portal.
    This happens when you use iframes (which behave in a similar fashion).
    - your only workaround is really to write some javascript function to "listen" to the portal login page getting loaded and then throwing the session into the parent browser (which is Portal). At least this is the only solution that I ever came up with when using Iframes.
    2) Don't know about out of memory error actually, but getting the "gatewy was not able to access requested content" is valid b/c the session died.
    - javascript errors require javascript solutions. Sorry I couldn't be more helpful than that.
    Maybe someone else will have better suggestions.
    The other suggestion is to use your app server to listen to the logout event and redirect appropriately to somewhere else, or have it do what you want it to do in situations as this.

  • Large Pdf using XML XSL - Out of Memory Error

    Hi Friends.
    I am trying to generate a PDF from XML, XSL and FO in java. It works fine if the PDF to be generated is small.
    But if the PDF to be generated is big, then it throws "Out of Memory" error. Can some one please give me some pointers about the possible reasons for this errors. Thanks for your help.
    RM
    Code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.xml.sax.InputSource;
    import org.xml.sax.XMLReader;
    import org.apache.fop.apps.Driver;
    import org.apache.fop.apps.Version;
    import org.apache.fop.apps.XSLTInputHandler;
    import org.apache.fop.messaging.MessageHandler;
    import org.apache.avalon.framework.logger.ConsoleLogger;
    import org.apache.avalon.framework.logger.Logger;
    public class PdfServlet extends HttpServlet {
    public static final String FO_REQUEST_PARAM = "fo";
    public static final String XML_REQUEST_PARAM = "xml";
    public static final String XSL_REQUEST_PARAM = "xsl";
    Logger log = null;
         Com_BUtil myBu = new Com_BUtil();
    public void doGet(HttpServletRequest request,
    HttpServletResponse response) throws ServletException {
    if(log == null) {
         log = new ConsoleLogger(ConsoleLogger.LEVEL_WARN);
         MessageHandler.setScreenLogger(log);
    try {
    String foParam = request.getParameter(FO_REQUEST_PARAM);
    String xmlParam = myBu.getConfigVal("filePath") +"/"+request.getParameter(XML_REQUEST_PARAM);
    String xslParam = myBu.SERVERROOT + "/jsp/servlet/"+request.getParameter(XSL_REQUEST_PARAM)+".xsl";
         if((xmlParam != null) && (xslParam != null)) {
    XSLTInputHandler input = new XSLTInputHandler(new File(xmlParam), new File(xslParam));
    renderXML(input, response);
    } else {
    PrintWriter out = response.getWriter();
    out.println("<html><head><title>Error</title></head>\n"+
    "<body><h1>PdfServlet Error</h1><h3>No 'fo' "+
    "request param given.</body></html>");
    } catch (ServletException ex) {
    throw ex;
    catch (Exception ex) {
    throw new ServletException(ex);
    public void renderXML(XSLTInputHandler input,
    HttpServletResponse response) throws ServletException {
    try {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    response.setContentType("application/pdf");
    Driver driver = new Driver();
    driver.setLogger(log);
    driver.setRenderer(Driver.RENDER_PDF);
    driver.setOutputStream(out);
    driver.render(input.getParser(), input.getInputSource());
    byte[] content = out.toByteArray();
    response.setContentLength(content.length);
    response.getOutputStream().write(content);
    response.getOutputStream().flush();
    } catch (Exception ex) {
    throw new ServletException(ex);
    * creates a SAX parser, using the value of org.xml.sax.parser
    * defaulting to org.apache.xerces.parsers.SAXParser
    * @return the created SAX parser
    static XMLReader createParser() throws ServletException {
    String parserClassName = System.getProperty("org.xml.sax.parser");
    if (parserClassName == null) {
    parserClassName = "org.apache.xerces.parsers.SAXParser";
    try {
    return (XMLReader) Class.forName(
    parserClassName).newInstance();
    } catch (Exception e) {
    throw new ServletException(e);

    Hi,
    I did try that initially. After executing the command I get this message.
    C:\>java -Xms128M -Xmx256M
    Usage: java [-options] class [args...]
    (to execute a class)
    or java -jar [-options] jarfile [args...]
    (to execute a jar file)
    where options include:
    -cp -classpath <directories and zip/jar files separated by ;>
    set search path for application classes and resources
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -showversion print product version and continue
    -? -help print this help message
    -X print help on non-standard options
    Thanks for your help.
    RM

  • U0093Critical program error occurred .u0093Client out of memory error u0093 - Query

    I have a problem with Query in BI 7.0
    Query works perfectly in BW3.5 environment.  BI 7.0 Vista and Excel 2007 environment – I have date range in the query – If I provide date range 4 months interval it is working fine.
    If I provide 5, 6,7, months interval – I am getting the error ,
    “Critical program error occurred .The program has to close. Please refer to the trace for further information.”
    Communication error, CPIC return code 020, SAP returns code 223
    “Client out of memory error “
    When I execute each interval this query and calculated the no of records – it is only less than 19,000 records.
    The same query working fine in Bw3.5  for more than year interval.
    Advance Thanks .

    It depends on the ssytem settings. The problem with your query is that it is not able to fetch all the data due to lack of memory. However, when you are giving smaller range, you are getting the output. You can either ask the basis guy to increase the memory space or try running the query by giving smaller date range. You can have some filters on your query also.
    Thanks...
    Shambhu

  • ERROR [B3108]: Unrecoverable out of memory error during a cluster operation

    We are using Sun Java(tm) System Message Queue Version: 3.5 SP1 (Build 48-G). We are using two JMS servers as a cluster.
    But we frequently getting the out of memory issue during the cluster operation.
    Messages also got queued up in the Topics. Eventhough listeners have the capability to reconnect with the Server after the broker restarting, usually we are restarting consumer instances to get work this.
    Here is detailed log :
    Jan 5 13:45:40 polar1-18.eastern.com imqbrokerd_cns-jms-18[8980]: [ID 478930 daemon.error] ERROR [B3108]: Unrecoverable out of memory error during a cluster operation. Shutting down the broker.
    Jan 5 13:45:57 polar1-18.eastern18.chntva1-dc1.cscehub.com imqbrokerd: [ID 702911 daemon.notice] Message Queue broker terminated abnormally -- restarting.
    Expecting your attention on this.
    Thanks

    Hi,
    If you do not use any special cmdline options, how do you configure your servers/
    brokers to 1 Gb or 2 Gb JVM heap ?
    Regarding your question on why the consumers appear to be connecting to just
    one of the brokers -
    How are the connection factories that the consumers use configured ?
    Is the connection factory configured using the imqAddressList and
    imqAddressListBehavior attributes ? Documentation for this is at:
    http://docs.sun.com/source/819-2571/ref_adminobj_props.html#wp62463
    imqAddressList should contain a list of brokers (i.e. 2 for you) in the cluster
    e.g.
    mq://server1:7676/jms,mq://server2:7676/jms
    imqAddressListBehavior defines how the 2 brokers in the above list are picked.
    The default is in the order of the list - so mq://server1:7676/jms will always be
    picked by default. If you want random behavior (which will hopefully even out the
    load), set imqAddressListBehavior to RANDOM.
    regards,
    -i
    http://www.sun.com/software/products/message_queue/index.xml

Maybe you are looking for

  • How to connect my airport time capsule to my at

    Am I missing some kind of special cord? I can start the software and the software recognizes the airport time capsule only if I plug the single ethenet cord into the time capule not the AT&T router. Anyone have a minute to help a big dummy here?

  • I want to create an ePub2 document should have a proper view in IPAD

    I created a ePub document as per the standard epub2 format but it is not to good to view in IPAD. IF i view it in ADE or kindle it is good to look but in IPAD the inline images are even placed in their position. So please anybody help me to built an

  • Some clients are not receiving my mail attachments.

    Some clients are not receiving my mail attachments. Other recipients of the same email DO receive these attachments. It doesn't matter whether it is a jpg, pdf, doc, or other. Sending from gmail or entourage works, only sending from apple mail is a p

  • How to use own or other creditcard in Family Share?

    Hello together, i'm using the Family Sharing functionality(for example my dad set up the Family Share), great ideal. But now i want to buy an App on my own and do not want to use the Family-Creditcard but my own creditcard (sometimes i want to pay on

  • Can a new Business Layer be tied to a specific schema?

    I feel like I'm missing something rather simple. We have a dedicated Connection that provides exposure to multiple schemas (SQL Server) and we have a universe already built (dev environment), we want to use the same Connection, but build out a new Bu