Out of Memory Error, Buffer Sizes, and Loop Rates on RT and FPGA

I'm attempting to use an FPGA to collect data and then transfer that data to a RT system via a FIFO DMA, and then stream it from my RT systeam over to my host PC. I have the basics working, but I'm having two problems...
The first is more of a nuisance. I keep receiving an Out of Memory error. This is a more recent development, but unfortunately I haven't been able to track down what is causing it and it seems to be independent of my FIFO sizes. While not my main concern, if someone was able to figure out why I would really appreciate it.
Second, I'm struggling with overflows. My FPGA is running on a 100 MHz clock and my RT system simply cannot seem to keep up. I'm really only looking at recording 4 seconds of data, but it seems that no matter what I do I can't escape the problem without making my FIFO size huge and running out of memory (this was before I always got the Out of Memory error). Is there some kind of tip or trick I'm missing? I know I can set my FPGA to a slower clock but the clock speed is an important aspect of my application.
I've attached a simplified version of my code that contains both problems. Thanks in advance for taking a look and helping me out, I appreciate any feedback!

David-A wrote:
The 7965 can't stream to a host controller faster than 800MB/s. If you need 1.6GB/s of streaming you'll need to get a 797x FPGA module.  
I believe the application calls for 1.6 GB over 4s, so 400 MB/s, which should be within the capabilities of the 7965.
I was going to say something similar about streaming over ethernet. I agree that it's going to be necessary to find a way to buffer most if not all of the data between the RT Target and the FPGA Target. There may be some benefit to starting to send data over the network, but the buffer on the host is still going to need to be quite large. Making use of the BRAMS and RAM on the 7965 is an interesting possibility.
As a more out there idea, what about replacing the disk in your 8133 with an SSD? I'm not entirely sure what kind of SATA connection is in the 8133, and you'd have to experiment to be sure, but I think 400 MB/s or close to that should be quite possible. You could write all the data to disk and then send it over the network from disk once the aquisiton is complete. http://digital.ni.com/public.nsf/allkb/F3090563C2FC9DC686256CCD007451A8 has some information on using SSDs with PXI Controllers.
Sebastian

Similar Messages

  • Why do I get a Track out of memory error while running open loop frequency response?

    MatrixX Build 61mx1411: I get a "Track out of memory" error when I run the Open Loop Frequency Response from the MatrixX pull down tools. What can I do to prevent this? We are running on an HP B1000 with 768 MB of RAM under HP-UX 10.2.

    In the old days of Mx say Version 5 and prior the user actually selected the amount of memory that would be allocated. Depending on the size of the model etc. you would have to allocate memory. In version 6.0 and going forward there is no need for the user to manually allocate the memory.
    Build {rstack=50000,istack=200000,sstack=50000,cstack=50​0 000}
    If this is a command in a script file that you are running and the error is resulting from that then I would try commenting out everything after the letter d in the word build and then starting it back up.
    i.e. only use Build
    I don't believe that there is a way to manually allocate the initial SystemBuild Stack size.
    I believe initially the stack size is set to 10010.
    However, one way
    you can manually set the initial SystemBuild stack size,is to create a large StateSpace as soon as you start up SystemBuild. This will prevent piece-meal reallocs while using SystemBuild.
    You can created a new SuperBlock in SystemBuild and then drop down a StateSpace Block with 199 inputs and 199 Outputs and 1 State and entered ones(200,200)as the StateSpace Matrix without any problems. This would resize this internal stack to at least 40000.
    You really should not have to do this but if that helps then you might think about doing this in your startup.ms file you could use SBA or load the file then you could delete the superblock and begin working.
    "Bob" gave me this little tid bit.
    Please let me know if any of this is of use.
    Garrett
    Garrett Thurston
    [email protected]
    Phone: 781.993.5540

  • Out of memory Error While deploying and building the application

    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0808f7ef, pid=5036, tid=5072
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_11-b06 mixed mode)
    # Problematic frame:
    # V [jvm.dll+0x8f7ef]
    --------------- T H R E A D ---------------
    Current thread (0x078b4ac0): JavaThread "ExecuteThread: '9' for queue: 'weblogic.kernel.Default'" daemon [_thread_in_vm, id=5072]
    siginfo: ExceptionCode=0xc0000005, reading address 0x079c7ffc
    Registers:
    EAX=0x00000000, EBX=0x078b4ac0, ECX=0x079c7ff0, EDX=0x0080908c
    ESP=0x0823f5a0, EBP=0x0823f5f8, ESI=0x0718ac70, EDI=0x00000000
    EIP=0x0808f7ef, EFLAGS=0x00010246
    Top of Stack: (sp=0x0823f5a0)
    0x0823f5a0: 08064249 0080908c 079c7ff0 0823f618
    0x0823f5b0: 0718ac20 0808f80a 0080908c 0808f7e5
    0x0823f5c0: 0718a220 0808eda6 0080908c 0003bc78
    0x0823f5d0: 0808eec6 0080908c 0823f618 00000001
    0x0823f5e0: 080925ab 0080908c 078b4d7c 00000001
    0x0823f5f0: 00000000 078b4ac0 0823f60c 0095f4f4
    0x0823f600: 0080908c 0823f618 078b4b5c 0823f628
    0x0823f610: 0095f4ac 078b4b5c 0080908c 0823f624
    Instructions: (pc=0x0808f7ef)
    0x0808f7df: 02 33 c0 c2 04 00 8b 4c 24 08 8b 54 24 04 33 c0
    0x0808f7ef: 3b 51 0c 0f 94 c0 c3 56 8b f1 68 e5 f7 08 08 ff
    Stack: [0x08200000,0x08240000), sp=0x0823f5a0, free space=253k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V [jvm.dll+0x8f7ef]
    C [jdwp.dll+0xf4f4]
    C [jdwp.dll+0xf4ac]
    C [jdwp.dll+0xbf91]
    C [jdwp.dll+0xbe23]
    C [jdwp.dll+0x7b6b]
    C [jdwp.dll+0x89c8]
    V [jvm.dll+0x8fc00]
    V [jvm.dll+0x909e4]
    V [jvm.dll+0x90291]
    V [jvm.dll+0x6df8a]
    j jsp_servlet._data_usage.__new_request._jspService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+2387
    j com.telus.smartdesktop.framework.JSPControllerServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+74
    j weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;+12
    j weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl;)V+387
    j weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl;)V+618
    j weblogic.servlet.internal.TailFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V+10
    j weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+28
    j com.sun.identity.agents.filter.AmAgentFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V+175
    j weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+28
    j weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;+79
    j weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/security/subject/AbstractSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;+34
    j weblogic.security.service.SecurityManager.runAs(Lweblogic/security/acl/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;+18
    j weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl;)V+685
    j weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel/ExecuteThread;)V+141
    j weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest;)V+23
    j weblogic.kernel.ExecuteThread.run()V+66
    v ~StubRoutines::call_stub
    V [jvm.dll+0x72846]
    V [jvm.dll+0xac976]
    V [jvm.dll+0x72753]
    V [jvm.dll+0x7244f]
    V [jvm.dll+0x72488]
    V [jvm.dll+0x8a3a0]
    V [jvm.dll+0xd0de8]
    V [jvm.dll+0xd0db6]
    C [MSVCRT.dll+0x2a3b0]
    C [kernel32.dll+0xb729]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j jsp_servlet._data_usage.__new_request._jspService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+2387
    j com.telus.smartdesktop.framework.JSPControllerServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+74
    j weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;+12
    j weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl;)V+387
    j weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl;)V+618
    j weblogic.servlet.internal.TailFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V+10
    j weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+28
    j com.sun.identity.agents.filter.AmAgentFilter.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Ljavax/servlet/FilterChain;)V+175
    j weblogic.servlet.internal.FilterChainImpl.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+28
    j weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;+79
    j weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/security/subject/AbstractSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;+34
    j weblogic.security.service.SecurityManager.runAs(Lweblogic/security/acl/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;+18
    j weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl;)V+685
    j weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel/ExecuteThread;)V+141
    j weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest;)V+23
    j weblogic.kernel.ExecuteThread.run()V+66
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x071c8520 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=5340]
    0x07aa37b0 JavaThread "Thread-20" daemon [_thread_in_native, id=3248]
    0x07f777f0 JavaThread "HvcReferenceDataPeriodicRefreshThread" daemon [_thread_blocked, id=1448]
    0x07aa30f0 JavaThread "SD-PerformanceMonitorThread" daemon [_thread_blocked, id=5856]
    0x08bb2b48 JavaThread "cache-PrepareThread" daemon [_thread_blocked, id=3968]
    0x07cfe008 JavaThread "cache-CommitThread" daemon [_thread_blocked, id=4128]
    0x00a59410 JavaThread "Thread-14" daemon [_thread_in_native, id=2096]
    0x073e0a20 JavaThread "ListenThread.Default" [_thread_in_native, id=4432]
    0x07b2b808 JavaThread "Thread-12" [_thread_blocked, id=4472]
    0x072ad9f8 JavaThread "Thread-11" daemon [_thread_in_native, id=4160]
    0x0893b648 JavaThread "RulesCachePeriodicRefreshThread" daemon [_thread_blocked, id=2024]
    0x07485828 JavaThread "ReferenceDataRefreshThread" daemon [_thread_blocked, id=2204]
    0x07e80408 JavaThread "ExecuteThread: '4' for queue: 'weblogic.socket.Muxer'" daemon [_thread_in_native, id=1588]
    0x071fb3e8 JavaThread "ExecuteThread: '3' for queue: 'weblogic.socket.Muxer'" daemon [_thread_in_native, id=3532]
    0x07bf4240 JavaThread "ExecuteThread: '2' for queue: 'weblogic.socket.Muxer'" daemon [_thread_in_native, id=112]
    0x07bf40d8 JavaThread "ExecuteThread: '1' for queue: 'weblogic.socket.Muxer'" daemon [_thread_in_native, id=3680]
    0x07294ea0 JavaThread "ExecuteThread: '0' for queue: 'weblogic.socket.Muxer'" daemon [_thread_in_native, id=6016]
    0x00a71e60 JavaThread "com.telus.provider.scheduling.Scheduler@b245dc" daemon [_thread_blocked, id=4636]
    0x07204828 JavaThread "ExecuteThread: '3' for queue: 'JMS.TimerClientPool'" daemon [_thread_blocked, id=5604]
    0x07b2cea0 JavaThread "ExecuteThread: '2' for queue: 'JMS.TimerClientPool'" daemon [_thread_blocked, id=1520]
    0x0791bea0 JavaThread "ExecuteThread: '1' for queue: 'JMS.TimerClientPool'" daemon [_thread_blocked, id=5496]
    0x07849ce0 JavaThread "ExecuteThread: '0' for queue: 'JMS.TimerClientPool'" daemon [_thread_blocked, id=3828]
    0x0739af88 JavaThread "Thread-6" daemon [_thread_blocked, id=2784]
    0x072241d0 JavaThread "ExecuteThread: '0' for queue: 'JMS.TimerTreePool'" daemon [_thread_blocked, id=4004]
    0x072eb7b8 JavaThread "weblogic.health.CoreHealthMonitor" daemon [_thread_blocked, id=3976]
    0x0754ace0 JavaThread "Thread-5" [_thread_blocked, id=3236]
    0x078eac38 JavaThread "DoSManager" [_thread_blocked, id=3740]
    0x07893190 JavaThread "VDE Transaction Processor Thread" [_thread_blocked, id=3408]
    0x07938408 JavaThread "ExecuteThread: '2' for queue: 'weblogic.admin.RMI'" daemon [_thread_blocked, id=4372]
    0x07abb408 JavaThread "ExecuteThread: '1' for queue: 'weblogic.admin.RMI'" daemon [_thread_blocked, id=5148]
    0x07aafda8 JavaThread "ExecuteThread: '0' for queue: 'weblogic.admin.RMI'" daemon [_thread_blocked, id=2656]
    0x0739c898 JavaThread "ExecuteThread: '1' for queue: 'weblogic.admin.HTTP'" daemon [_thread_blocked, id=4264]
    0x074009b8 JavaThread "ExecuteThread: '0' for queue: 'weblogic.admin.HTTP'" daemon [_thread_blocked, id=5196]
    0x078004a8 JavaThread "weblogic.security.SpinnerRandomSource" daemon [_thread_blocked, id=3516]
    0x077ffea8 JavaThread "weblogic.time.TimeEventGenerator" daemon [_thread_blocked, id=1296]
    0x0718aea0 JavaThread "ExecuteThread: '4' for queue: 'weblogic.kernel.System'" daemon [_thread_blocked, id=2072]
    0x0718a220 JavaThread "ExecuteThread: '3' for queue: 'weblogic.kernel.System'" daemon [_thread_blocked, id=2832]
    0x071895d8 JavaThread "ExecuteThread: '2' for queue: 'weblogic.kernel.System'" daemon [_thread_blocked, id=3696]
    0x071d6ed8 JavaThread "ExecuteThread: '1' for queue: 'weblogic.kernel.System'" daemon [_thread_blocked, id=4064]
    0x071d6ac0 JavaThread "ExecuteThread: '0' for queue: 'weblogic.kernel.System'" daemon [_thread_blocked, id=5168]
    0x071d5640 JavaThread "ExecuteThread: '14' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=1184]
    0x071d4ab8 JavaThread "ExecuteThread: '13' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=2200]
    0x07401b68 JavaThread "ExecuteThread: '12' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=4608]
    0x07a99900 JavaThread "ExecuteThread: '11' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=5900]
    0x078b4df8 JavaThread "ExecuteThread: '10' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=4028]
    =>0x078b4ac0 JavaThread "ExecuteThread: '9' for queue: 'weblogic.kernel.Default'" daemon [_thread_in_vm, id=5072]
    0x078b4018 JavaThread "ExecuteThread: '8' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=4108]
    0x07380448 JavaThread "ExecuteThread: '7' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=4740]
    0x07477c30 JavaThread "ExecuteThread: '6' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=4668]
    0x07477a28 JavaThread "ExecuteThread: '5' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=844]
    0x07bdda60 JavaThread "ExecuteThread: '4' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=4588]
    0x07bdd8f8 JavaThread "ExecuteThread: '3' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=3732]
    0x07195918 JavaThread "ExecuteThread: '2' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=5588]
    0x071957b0 JavaThread "ExecuteThread: '1' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=5116]
    0x0787d008 JavaThread "ExecuteThread: '0' for queue: 'weblogic.kernel.Default'" daemon [_thread_blocked, id=4956]
    0x07a7b1f8 JavaThread "Thread-1" daemon [_thread_blocked, id=5328]
    0x00a148a8 JavaThread "CompilerThread0" daemon [_thread_blocked, id=5716]
    0x00a139c0 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3524]
    0x00a12538 JavaThread "JDWP Event Helper Thread" daemon [_thread_in_native, id=5680]
    0x009d4d38 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_native, id=5748]
    0x009d1530 JavaThread "Finalizer" daemon [_thread_blocked, id=4868]
    0x009d0120 JavaThread "Reference Handler" daemon [_thread_blocked, id=4184]
    0x0003ce58 JavaThread "main" [_thread_blocked, id=420]
    Other Threads:
    0x00a116f8 VMThread [id=3084]
    0x00a164f8 WatcherThread [id=4416]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
    [0x0003bc78/0x00000f20] Threads_lock - owner thread: 0x078b4ac0
    Heap
    def new generation total 36288K, used 13059K [0x10010000, 0x12770000, 0x12770000)
    eden space 32256K, 32% used [0x10010000, 0x10a2b788, 0x11f90000)
    from space 4032K, 67% used [0x12380000, 0x12625788, 0x12770000)
    to space 4032K, 0% used [0x11f90000, 0x11f90000, 0x12380000)
    tenured generation total 483968K, used 27091K [0x12770000, 0x30010000, 0x30010000)
    the space 483968K, 5% used [0x12770000, 0x141e4ec0, 0x141e5000, 0x30010000)
    compacting perm gen total 44544K, used 44391K [0x30010000, 0x32b90000, 0x34010000)
    the space 44544K, 99% used [0x30010000, 0x32b69d30, 0x32b69e00, 0x32b90000)
    Dynamic libraries:
    0x00400000 - 0x0040b000      C:\bea\jdk142_11\jre\bin\java.exe
    0x7c900000 - 0x7c9b2000      C:\WINDOWS\system32\ntdll.dll
    0x7c800000 - 0x7c8f6000      C:\WINDOWS\system32\kernel32.dll
    0x77dd0000 - 0x77e6b000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77e70000 - 0x77f03000      C:\WINDOWS\system32\RPCRT4.dll
    0x77fe0000 - 0x77ff1000      C:\WINDOWS\system32\Secur32.dll
    0x77c10000 - 0x77c68000      C:\WINDOWS\system32\MSVCRT.dll
    0x08000000 - 0x0813f000      C:\bea\jdk142_11\jre\bin\client\jvm.dll
    0x7e410000 - 0x7e4a1000      C:\WINDOWS\system32\USER32.dll
    0x77f10000 - 0x77f59000      C:\WINDOWS\system32\GDI32.dll
    0x76b40000 - 0x76b6d000      C:\WINDOWS\system32\WINMM.dll
    0x76390000 - 0x763ad000      C:\WINDOWS\system32\IMM32.DLL
    0x10000000 - 0x10007000      C:\bea\jdk142_11\jre\bin\hpi.dll
    0x76bf0000 - 0x76bfb000      C:\WINDOWS\system32\PSAPI.DLL
    0x003a0000 - 0x003ae000      C:\bea\jdk142_11\jre\bin\verify.dll
    0x003c0000 - 0x003d9000      C:\bea\jdk142_11\jre\bin\java.dll
    0x003e0000 - 0x003ee000      C:\bea\jdk142_11\jre\bin\zip.dll
    0x00950000 - 0x0096c000      C:\bea\jdk142_11\jre\bin\jdwp.dll
    0x003f0000 - 0x003f5000      C:\bea\jdk142_11\jre\bin\dt_socket.dll
    0x71ab0000 - 0x71ac7000      C:\WINDOWS\system32\ws2_32.dll
    0x71aa0000 - 0x71aa8000      C:\WINDOWS\system32\WS2HELP.dll
    0x71a50000 - 0x71a8f000      C:\WINDOWS\system32\mswsock.dll
    0x662b0000 - 0x66308000      C:\WINDOWS\system32\hnetcfg.dll
    0x71a90000 - 0x71a98000      C:\WINDOWS\System32\wshtcpip.dll
    0x06fb0000 - 0x06fbf000      C:\bea\jdk142_11\jre\bin\net.dll
    0x76f20000 - 0x76f47000      C:\WINDOWS\system32\DNSAPI.dll
    0x76fb0000 - 0x76fb8000      C:\WINDOWS\System32\winrnr.dll
    0x76f60000 - 0x76f8c000      C:\WINDOWS\system32\WLDAP32.dll
    0x76fc0000 - 0x76fc6000      C:\WINDOWS\system32\rasadhlp.dll
    0x070d0000 - 0x070d8000      C:\bea\jdk142_11\jre\bin\nio.dll
    0x070e0000 - 0x070e6000      C:\bea\jdk142_11\jre\bin\ioser12.dll
    0x09940000 - 0x09945000      C:\bea\weblogic81\server\bin\stackdump.dll
    0x09950000 - 0x09955000      C:\bea\weblogic81\server\bin\wlntio.dll
    0x68000000 - 0x68036000      C:\WINDOWS\system32\rsaenh.dll
    0x769c0000 - 0x76a74000      C:\WINDOWS\system32\USERENV.dll
    0x5b860000 - 0x5b8b5000      C:\WINDOWS\system32\netapi32.dll
    VM Arguments:
    jvm_args: -Xmx512M -Xms512M -Dcom.telus.provider.initialContextFactory=weblogic.jndi.WLInitialContextFactory -Dcom.telus.provider.providerURL=t3://wlpt168smartdteca:6382 -Dcom.telus.credit.providerURL=t3://wlpt168eascommonservices:8623 -Dcom.telusmobility.config.java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory -Dcom.telusmobility.config.java.naming.provider.url=ldap://ldapread-pt168.tmi.telus.com:589/cn=pt168_81,o=telusconfiguration -DignoreIdentity=true -Dbranding=super -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=9090,suspend=n,server=y -Dweblogic.Domain=smartdesktop -Dbea.home=C:\bea -Djava.security.policy==C:\bea\weblogic81\server\lib\weblogic.policy -Dweblogic.ProductionModeEnabled=false
    java_command: weblogic.Server
    Launcher Type: SUN_STANDARD
    Environment Variables:
    JAVA_HOME=C:\bea\jdk142_11
    CLASSPATH=C:\bea\JROCKI~1\lib\tools.jar;C:\bea\WEBLOG~1\server\lib\weblogic_sp.jar;C:\bea\WEBLOG~1\server\lib\weblogic.jar;C:\bea\WEBLOG~1\common\eval\pointbase\lib\pbserver44.jar;C:\bea\WEBLOG~1\common\eval\pointbase\lib\pbclient44.jar;C:\bea\JROCKI~1\jre\lib\rt.jar;C:\bea\WEBLOG~1\server\lib\webservices.jar;.;C:\Program Files\Java\jre1.5.0_09\lib\ext\QTJava.zip;..\..\..\..\common\ThirdParty\sun\mail\activation.jar;..\..\..\..\common\ThirdParty\sun\mail\mail.jar
    PATH=C:\bea\WEBLOG~1\server\bin;C:\bea\jdk142_11\jre\bin;C:\bea\jdk142_11\bin;C:\bea\WEBLOG~1\server\bin;C:\bea\jdk142_11\jre\bin;C:\bea\jdk142_11\bin;C:\bea\WEBLOG~1\server\bin;C:\bea\JROCKI~1\jre\bin;C:\bea\JROCKI~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files\ActivIdentity\ActivClient\;C:\Program Files\Borland\CaliberRM SDK 2008\lib;C:\Program Files\Borland\StarTeam SDK 10.0\Lib;C:\Program Files\Borland\StarTeam SDK 10.0\Bin;C:\Program Files\Borland\CaliberRM SDK 2008;C:\Program Files\Borland\StarTeam SDK 10.0;C:\Program Files\Windows Imaging\;C:\Program Files\Oracle\jre\1.1.8\bin\;C:\Oracle9i\bin\;C:\ORACLE\Product\11.2.0\client_1;C:\WINDOWS\system32\;C:\WINDOWS\system32\Wbem;C:\Program Files\InstallShield\AdminStudio\6.0\ConflictSolver;C:\Program Files\ClickSoftware\Service Optimization\Bin;C:\Program Files\Windows Imaging;C:\Program Files\QuickTime\QTSystem\;C:\bea\WEBLOG~1\server\bin\oci920_8;C:\bea\WEBLOG~1\server\bin\oci920_8
    USERNAME=x120751
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 37 Stepping 5, GenuineIntel
    --------------- S Y S T E M ---------------
    OS: Windows XP Build 2600 Service Pack 3
    CPU:total 4 family 6, cmov, cx8, fxsr, mmx, sse, sse2
    Memory: 4k page, physical 2097151k(1723568k free), swap 4194303k(4117288k free)
    vm_info: Java HotSpot(TM) Client VM (1.4.2_11-b06) for windows-x86, built on Feb 13 2006 10:19:30 by "java_re" with MS VC++ 6.0
    My ant build.xml is as given below
    <case value="pt">
    <property name="jvmArgs" value="-hotspot -Xmx512M -Xms512M -Dcom.telus.provider.initialContextFactory=weblogic.jndi.WLInitialContextFactory -Dcom.telus.provider.providerURL=cc://wlpt111smartdteca:4444 -Dcom.telus.cd.providerURL=w3://wlpt111eascommonservices:444 -Dcom.mobility.config.java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory -Dcom.bility.config.java.naming.provider.url=ldap://ldapread-pt.tmi.cins.com:555/cn=pt33_181,o=telusconfiguration"/>
    </case>
    <java failonerror="true" fork="true" dir="${deployDir}/jspc" classname="weblogic.appc" classpathref="appc.classpath">
    <jvmarg line="-Xmx1024M -Xms1024M"/>
    <arg line="-forceGeneration -verbose -deprecation ${sourceDir}/html"/>
    </java>

    Hi user13118647,
    It looks like your application is triggering an existing Sun HotSpot VM bug from the older 1.4.2_11 JDK.
    Please review the Sun bug references below.
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6405062
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6385867
    The problem appears to be resolved in JDK 1.4.2_13(b01). You may want to download and attempt to replicate with this service pack upgrade.
    Another potential problem I noticed is at your classpath level. It looks like you are using a mix of runtime JDK jar files from the Sun JDK and JRockit. Please ensure your JDK classpath; including any reference to any JDK related runtime jar files (tools.jar, rt.jar etc.) is consistent and unique e.g. Sun HotSpot or Oracle JRockit but not both.
    ## Example:
    JAVA_HOME=C:\bea\jdk142_11 // JDK home is setup to the Sun JDK
    CLASSPATH=C:\bea\JROCKI~1\lib\tools.jar; // tools.jar is loaded from the JRockit JDK home
    Regards,
    P-H
    http://javaeesupportpatterns.blogspot.com/

  • Ssh to Mac: periodic "out of memory" errors abort connection at login

    I have a frequent, but not constant problem...
    when I ssh to my Mac at home, from Linux boxes from work, and/or from my PC laptop (using putty), I often have to attempt to connect several times. The failing attempts ask for my password and seem to complete the login process.
    But at the 1st command I enter at the shell prompt, I see the message
    tcsh: out of memory
    very briefly, and then the window closes itself, and poof no more ssh connection...
    This seems to go in spurts, then one of the windows will be fine.
    For a while, it seemed that doing a quick ls as my first command worked around the problem, but I'm finding that not to be the case while on this trip (with my laptop and putty).
    I've done a pretty wide search and am coming up with very little on this.
    Any ideas?
    Again, sometimes it works, and ssh operates as expected. other time I can get several OOM errors in a row, before finally getting a working session. This is a not a new problem, has happened for at least a year, but seems to be worse lately.
    Thanks,
    Mike
    Mini Duo   Mac OS X (10.4.7)  

    Thanks, I'll give this a shot when I back in town this weekend...
    in the meantime, I've played around some more.. commented out most of my .login/.cshrc etc, to see if there were any culprits..
    over the ssh connection, if I try to change shells I can see the out of memory error sometimes, there, and the shell launch fails kicking back into the parent shell. When there is no "parent" shell, (original ssh login), the failure has no where to fall back to and the session terminates.
    I do not recall ever seeing this from Terminal (at my mac itself).
    So I guess that begs the question.. what is different about getting to a shell prompt from a remote ssh session vs. being there in person with Terminal?
    Mike

  • Oracle Service Bus For loop getting out of memory error

    I have a business service that is based on a JCA adapter to fetch an undertimed amout of records from a database.  I then need to upload those to another system using a webservice designed by an external source.  This web service will only accept upto to x amount of records.
    The process:
    for each object in the Jca Response
          Insert object into Service callout Request body
          if object index = number of objects in jca response or object index = next batch index
               Invoke service callout
               Append service callout Response to a total response object (xquery transform)
               increase next batch index by Batch size
               reset service callout to empty body
           endif
    end for
    replace body  with total response object.
    If I use the data set that only has 5 records  and use a batch size of 2 the process works fine.
    If I use  a data set with 89 records  and a batch size of 2 I get the below out of memory error  after about 10 service callouts
    the quantity of data in the objects is pretty small, less than 1kB for each JCA Object
    Server Name:
    AdminServer
    Log Name:
    ServerLog
    Message:
    Failed to process response message for service ProxyService Sa/Proxy Services/DataSync:
    java.lang.OutOfMemoryError: allocLargeObjectOrArray:
    [C, size 67108880 java.lang.OutOfMemoryError: allocLargeObjectOrArray:
    [C, size 67108880 at org.apache.xmlbeans.impl.store.Saver$TextSaver.resize(Saver.java:1700)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.preEmit(Saver.java:1303) at
    org.apache.xmlbeans.impl.store.Saver$TextSaver.emit(Saver.java:1234)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.emitXmlns(Saver.java:1003)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.emitNamespacesHelper(Saver.java:1021)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.emitElement(Saver.java:972)
    at org.apache.xmlbeans.impl.store.Saver.processElement(Saver.java:476)
    at org.apache.xmlbeans.impl.store.Saver.process(Saver.java:307)
    at org.apache.xmlbeans.impl.store.Saver$TextSaver.saveToString(Saver.java:1864)
    at org.apache.xmlbeans.impl.store.Cursor._xmlText(Cursor.java:546)
    at org.apache.xmlbeans.impl.store.Cursor.xmlText(Cursor.java:2436)
    at org.apache.xmlbeans.impl.values.XmlObjectBase.xmlText(XmlObjectBase.java:1500)
    at com.bea.wli.sb.test.service.ServiceTracer.getXmlData(ServiceTracer.java:968)
    at com.bea.wli.sb.test.service.ServiceTracer.addDataType(ServiceTracer.java:944)
    at com.bea.wli.sb.test.service.ServiceTracer.addDataType(ServiceTracer.java:924)
    at com.bea.wli.sb.test.service.ServiceTracer.addContextChanges(ServiceTracer.java:814)
    at com.bea.wli.sb.test.service.ServiceTracer.traceExit(ServiceTracer.java:398)
    at com.bea.wli.sb.pipeline.debug.DebuggerTracingStep.traceExit(DebuggerTracingStep.java:156)
    at com.bea.wli.sb.pipeline.PipelineContextImpl.exitComponent(PipelineContextImpl.java:1292)
    at com.bea.wli.sb.pipeline.MessageProcessor.finishProcessing(MessageProcessor.java:371)
    at com.bea.wli.sb.pipeline.RouterCallback.onReceiveResponse(RouterCallback.java:108)
    at com.bea.wli.sb.pipeline.RouterCallback.run(RouterCallback.java:183)
    at weblogic.work.ContextWrap.run(ContextWrap.java:41)
    at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Subsystem:
    OSB Kernel
    Message ID:
    BEA-382005
    It appears to be the service callout that is the problem (it calls another OSB service that logins and performs the data upload to the External service)  because If I change the batch size up to 100  the loop will load all the 89 records into the callout request and execute it fine.  If I have a small batch size then I run out of memory.
    Is there some settings I need to change?  Is there a better way in OSB (less memory intensive than service callout in a for loop)?
    Thanks.

    hi,
    Could you please let me know if you get rid off this issue as we are also facing the same issue.
    Thanks,
    SV

  • Out of memory errors when trying to sync local and remote sites

    We cannot get our remote and local sites synchronized for the first time. We have a huge site and we get out or memory errors or the synch just doesn't work. Any solutions or insights?
    Our site has 9,000+ HTML files and accompanying images, pdfs, etc. When we try to synch the remote to the local for the first time, it just will not happen. Every once in a while someone gets lucky, but for the most part, we either get an "out of memory" error or the synch just doesn't work, and it doesn't tell us anything. It just stops responding. HELP!

    Hi dmooresatx,
    I am not aware of the limitations of the file sizes that are allowed for a successful sync operation. If you are using a purchased version of Dreamweaver CC, send me your Adobe ID along with your contact details (phone, email number). Click on my picture and use the message option. If you are using a team license, get these details from your administrator.
    Thanks,
    Preran

  • JNI and Out of Memory errors

    Hi,
    At my job, we seem to have a memory leak related to JNI. We know we
    have a memory leak because we keep getting Out of Memory errors even
    after increasing the maximum heap size to more than 256 megs. And we
    know that this is the application that is eating up all the system
    memory.
    We are running under Windows 2000, with both JDK 1.3.0 and JDK 1.4.1.
    We tried looking at the problem under JProbe, but it shows a stable
    Java heap (no problems, except that the Windows task manager shows it
    growing and growing...)
    I tried a strip down version, where I set the max heap size to 1 Meg,
    and print out the total memory, memory used, and maximum memory used at
    a 5 sec interval.
    Memory used = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory().
    Well, I let that strip down version running for about a day. The
    maximum memory used has stabilized to about 1.1 Meg, and has not
    increased. The current memory used increases until it gets to some
    threshold, then it decreases again. However, the Windows task manager
    shows the memory increasing -- and currently it is at 245 Megs!
    In the lab, the behavior we see with the Windows task manager is as
    follows:
    1. Total memory used in the system increases until some threshold.
    2. Then it goes back down by about 100 Megs.
    3. This cycle continues, but at each cycle the memory goes back down
    less and less, until the app crashes.
    Now, our theory is that JNI is consuming all this memory (maybe we are
    using JNI wrong). That's the only explanation we can come up with to
    explain what we have seen (Java showing an OK heap, but the task
    manager showing it growing, until crashing).
    Does that make sense? Can the new operator throw an Out of Memory
    error if the system does not have enough memory to give it, even if
    there is still free heap space as far as the Runtime object is
    concerned? Does the Runtime object figures objects allocated through
    JNI methods into the heap used space?
    Note that I know the task manager is not a reliable indicator.
    However, I don't think a Java app is supposed to runaway with system
    memory -- the problem is not simply that the Java app is consuming too
    much memory, but that it seems to always want more memory. Besides, we
    do get the Out of Memory error.
    Thanks for your help,
    Nicolas Rivera

    Hi,
    there are two sources of memory leakage in JNI:
    - regular leaks in c/c++ code;
    - not released local/global references of java objects in JNI.
    I think that the first issue in not a problem for you. The second is more complex. In your JNI code you should check
    - how many local references alive you keep in your code as their number is restricted (about 16 and can be enlarged). The good style is not to store local references but keep only global.
    - any local reference accepted from java call in JNI are released by JVM. You should release local references you created in JNI and also global references.
    - do not use a large number of java object references. Each new reference gets new memory in JVM. Try to reuse refences.
    I guess that is your problem.
    Vitally

  • Out of Memory Error bcoz of xml file size

    Hi,
    Help me to solve this out of memory error, if xml file size
    is increased means
    it is not displaying anything and displaying this out of
    memory error.
    Thanking you
    Regards
    Nirmalatha.N

    You should avoid loading large sized XML files in your Flash
    Lite application. There is a limit on incoming data, and anything
    beyond that will give an error. My experience has been around 1000
    characters in a single stream of incoming text.
    A possible solution your memory problem is to use a middle
    language like PHP, ASP etc, to stream a single XML data file in
    parts to your Flash Lite application. This means you avoid loading
    XML directly in Flash.
    Mariam

  • Out of Memory Error and large video files

    I created a simple page that links a few large video files (2.5 gig) total size. On Preview or FTP upload Mues crashes and gives a Out of Memory error. How should we handle very large files like this?

    Upload the files to your host using an FTP client (i.e. Filezilla) and hyperlink to them from within your Muse site.
    Muse is currently not designed to upload files this large. The upload functionality takes the simple approach of reading an entire linked file into RAM and then uploading it. Given Muse is currently a 32-bit application, it's limited to using 2Gb of RAM (or less) at any given time regardless of how much RAM you have physically installed. We should add a check to the "Link to File..." feature so it rejects files larger than a few hundred megs and puts up a explanation alert. (We're also hard at work on the move to being a 64-bit app, but that's not a small change.)
    In general your site visitor will have a much better experience viewing such videos if you upload them to a service like YouTube or Vimeo rather than hosting them yourself. Video hosting services provide a huge amount of optimization of the delivery of video that's not present for a file hosted on standard hosting (i.e. automatic resizing of the video to the appropriate resolution for the visitor's device (rather than potentially downloading a huge amount of unneeded data), transcoding to the video format required by the visitor's browser (rather than either having to due so yourself or have some visitors unable to view your video), automatic distribution of a highly viewed video to multiple data centers for better performance in multiple geographies, and no doubt tons of other stuff I'm not thinking of or am ignorant of.

  • RoboHelp 9 gives an out of memory error and crashes when I try to import or link a Frame 10 file or

    I have Tech Suite 3. If I start a new RoboHelp project and try to import or link Frame files, RoboHelp tries for a while, then I get an Out of Memory error and the program crashes.
    I opened one of the sample projects and was able to link to one of my frame files without any problem, so it seems to be an issue with creating something new.
    Any suggestions?

    It happens when I create a new project and then try to import or link frame docs to make up the content. It starts scanning, then crashes. I did get it to the conversion setting page once, but no further.
    It does not happen if I open one of the supplied example projects and link a file. But then it doesn't let me choose, during import, any style mapping. And I can't delete the sample project fold
    Twice now it has told me when I tried to import (not link, but import) that my .fm file could not be opened, and told me to verify that Frame is installed (it is) and that the file is a valid frame file (it is).
    The docs and project are in separate folders on my C: drive.

  • Scaling images and Out of memory error

    Hi all,
    Does anyone knows why this code throws an out of memory error?
    It loads an image (2048x1166 pixels) and saves it at bufi1 (BufferedImage). After that:
    1- Rescale bufi1 to bufi13A (x3).
    2. Rescale bufi1 to bufi12 (x2).
    3. Rescale bufi1 to bufi13B (x3).
    At 3, the code throws an oome. Why?
    Thanks in advance!
    import java.io.*;
    import javax.imageio.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    public class TestScalePercent {
      public static void main(String[] args) {
        TestScalePercent tsp=new TestScalePercent();
        BufferedImage bufi1=null;
        try {
          bufi1 = ImageIO.read(new File("foo.png"));//2048x1166 pixels
        } catch (Exception e){
          e.printStackTrace();
        BufferedImage bufi13A=tsp.scale(bufi1,3,3);//--> OK
        BufferedImage bufi12=tsp.scale(bufi1,2,2);//--> OK
        BufferedImage bufi13B=tsp.scale(bufi1,3,3);//-->OOM error!
      public BufferedImage scale(BufferedImage bufiSource, double scaleX, double scaleY){
        AffineTransform tx = new AffineTransform();
        tx.scale(scaleX,scaleY);
        AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
        BufferedImage bufiop=op.filter(bufiSource, null);//--> Creates the OOM error...
        return op.filter(bufiop, null);
    }

    How much memory does your machine have?
    That image is quite large. If my math is correct and
    assuming the image has 32-bit color the original
    image takes up 76.5 megs of memory by itself. Then
    you are trying to create three other versions of it.
    It isn't lying to you, it is indeed probably running
    out of memory to hold the images.OK. Now I'm wondering if is it possible to free memory between bufi13A - bufi12, and bufi12 - bufi13B? I've tried to invocate the garbbage collector but nothing happens...
    Thanks!

  • Thread Count and Out Of Memory Error

    Hi,
    I was wondering if setting the ThreadPoolSize to a value which is too low can
    cause an out of memory error. My thought is that when it is time for Weblogic
    to begin garbage collection, if it does not get a thread fast enough it is possible
    that memory would be used up before the garbage collection takes place.
    I am asking this because I am trying to track down the cause of an out-of-memory
    occurrence, while at the same time I believe I need to raise the ThreadPoolSize.
    Thanks,
    Mark

    Oops ...
    I was wondering if setting the ThreadPoolSize to a value which is too
    low can cause an out of memory error.No, but the opposite can be true.
    My thought is that when it is time for Weblogic
    to begin garbage collection, if it does not get a thread fast enough it is
    possible that memory would be used up before the garbage collection
    takes place.Weblogic doesn't do GC ... that's the JVM and if it needs a thread it will
    not be using one of Weblogic's execute threads.
    > I am asking this because I am trying to track down the cause of an
    out-of-memory occurrenceIt could be configuration (new vs. old heap for example), but it is probably
    just data that you are holding on to or native stuff (e.g. type 2 JDBC
    driver objects) that you aren't cleaning up correctly.
    while at the same time I believe I need to raise the ThreadPoolSize.Wait until you fix the memory issue.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Mark Glatzer" <[email protected]> wrote in message
    news:[email protected]..

  • Data structure and out of memory error

    I have a program need to load data files and store the float data values in 3 two dimentional array. These data files are generated from biological experiments and are quite large. For e.g., when I tried to load 59 files, each file has 409,600 rows and store these data in 3 Float[][] arrays, like following
    pixel: Float[59][409600]
    signal: Float[59][409600]
    std: Float[59][409600]
    I know the variables of float data type occupy 4 bytes in memory, is this true for the object of Float data type(the wrapper class for float)?
    After cacluation, the total memory needed for the three 2D arrays are:
    4 * 409600 * 59 * 3 = 276.6 (MB)
    I'm using JBuilder 9 Personel and already set the parameter of -XmX as 800 MB, but I still get out of memory error in the middle of loading. Could you give a hand on this issue?
    thanks a lot!

    ok, you mean the Float object will take 24 bytes to
    store in memory instead of 4 bytes needed for float
    variable, right?Yes it's about 20 bytes per Float object. 4 for the actual float and about 16 in overhead. And then 4 bytes for the reference to the object in the array. So each float will occupy a total of about 24 bytes whereas a float just takes 4.
    Would you please give me a clue where
    you get this information?Well an object stores the actual data and has an overhead of about 16 bytes so it's just to add it up -:) I use this as a rule of thumb. I don't remember anymore where I got it in the first place.
    The purpose to store in
    Float object is to display these data directly in
    JTable to reduce the overhead for displaying data in
    table.Yes but it's better to minimize the storage of the raw bulk data. You can always have getter methods that return Float objects to the rest of the program "on demand".
    I've a class to create the table model by
    subclassing the AbstractTableModel. Based on these
    loaded raw data, I've to do other expensive operation
    using different analysis methods. So maybe using the
    built in data type is more effcient in my later
    calcuations.It's always a tradeoff. Use float for fast calculations and raw storage, and Float otherwise for maximum object orientation.

  • 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?

  • Out of memory error - from parsing a "fixed width file"

    This may be fairly simple for someone out there but I am trying to write a simple program that can go through a "fixed width" flat txt file and parse it to be comma dilmeted.
    I use a xml file with data dictionary specifications to do the work. I do this because there are over 430 fields that need to be parsed from a fixed width with close to 250,000 lines I can read the xml file fine to get the width dimensions but when I try to apply the parsing instructions, I get an out of memory error.
    I am hoping it is an error with code and not the large files. If it is the latter, does anyone out there know some techniques for getting at this data?
    Here is the code
       import java.io.*;
       import org.w3c.dom.Document;
       import org.w3c.dom.*;
       import javax.xml.parsers.DocumentBuilderFactory;
       import javax.xml.parsers.DocumentBuilder;
       import org.xml.sax.SAXException;
       import org.xml.sax.SAXParseException;
        public class FixedWidthConverter{
          String[] fieldNameArray;
          String[] fieldTypeArray;
          String[] fieldSizeArray;      
           public static void main(String args []){
             FixedWidthConverter fwc = new FixedWidthConverter();
             fwc.go();
             fwc.loadFixedWidthFile();
            //System.exit (0);
          }//end of main
           public void go(){
             try {
                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                Document doc = docBuilder.parse (new File("files/dic.xml"));
                // normalize text representation            doc.getDocumentElement ().normalize ();
                System.out.println ("Root element of the doc is " +
                     doc.getDocumentElement().getNodeName());
                NodeList listOfFields = doc.getElementsByTagName("FIELD");
                int totalFields = listOfFields.getLength();
                System.out.println("Total no of fields : " + totalFields);
                String[] fldNameArray = new String[totalFields];
                String[] fldTypeArray = new String[totalFields];
                String[] fldSizeArray = new String[totalFields];
                for(int s=0; s<listOfFields.getLength() ; s++){
                   Node firstFieldNode = listOfFields.item(s);
                   if(firstFieldNode.getNodeType() == Node.ELEMENT_NODE){
                      Element firstFieldElement = (Element)firstFieldNode;
                      NodeList firstFieldNMList = firstFieldElement.getElementsByTagName("FIELD_NM");
                      Element firstFieldNMElement = (Element)firstFieldNMList.item(0);
                      NodeList textFNList = firstFieldNMElement.getChildNodes();
                      //System.out.println("Field Name : " +
                               //((Node)textFNList.item(0)).getNodeValue().trim());
                      //loads values into an array
                      //fldNameArray[s] = ((Node)textFNList.item(0)).getNodeValue().trim();
                      NodeList typeList = firstFieldElement.getElementsByTagName("TYPE");
                      Element typeElement = (Element)typeList.item(0);
                      NodeList textTypList = typeElement.getChildNodes();
                      //System.out.println("Field Type : " +
                               //((Node)textTypList.item(0)).getNodeValue().trim());
                      //loads values into an array
                      //fldTypeArray[s] = ((Node)textTypList.item(0)).getNodeValue().trim(); 
                      NodeList sizeList = firstFieldElement.getElementsByTagName("SIZE");
                      Element sizeElement = (Element)sizeList.item(0);
                      NodeList textSizeList = sizeElement.getChildNodes();
                      //System.out.println("Field Size : " +
                               //((Node)textSizeList.item(0)).getNodeValue().trim());
                      //loads values into an array
                      fldSizeArray[s] = ((Node)textSizeList.item(0)).getNodeValue().trim();   
                   }//end of if clause
                }//end of for loop with s var
                //setFldNameArray(fldNameArray);
                //setFldTypeArray(fldTypeArray);
                setFldSizeArray(fldSizeArray);
                 catch (SAXParseException err) {
                   System.out.println ("** Parsing error" + ", line "
                      + err.getLineNumber () + ", uri " + err.getSystemId ());
                   System.out.println(" " + err.getMessage ());
                 catch (SAXException e) {
                   Exception x = e.getException ();
                   ((x == null) ? e : x).printStackTrace ();
                 catch (Throwable t) {
                   t.printStackTrace ();
          }//end go();
           public void setFldNameArray(String[] s){
             fieldNameArray = s;
          }//end setFldNameArray
           public void setFldTypeArray(String[] s){
             fieldTypeArray = s;
          }//end setFldTypeArray
           public void setFldSizeArray(String[] s){
             fieldSizeArray = s;
          }//end setFldSizeArray
           public String[] getFldNameArray(){
             return fieldNameArray;
          }//end setFldNameArray
           public String[] getFldTypeArray(){
             return fieldTypeArray;
          }//end setFldTypeArray
           public String[] getFldSizeArray(){
             return fieldSizeArray;
          }//end setFldSizeArray 
           public int getNumLines(){
             int countLines = 0;
             try {
                    //File must be in same director and be the name of the string below
                BufferedReader in = new BufferedReader(new FileReader("files/FLAT.txt"));
                String str;
                while ((str = in.readLine()) != null) {
                   countLines++;
                in.close();
                 catch (IOException e) {}    
             return countLines;
          }//end of getNumLines
           public void loadFixedWidthFile(){
             int c = getNumLines();
             int i = 0;
             String[] lineProcessed = new String[c];
             String chars;
             try {
                    //File must be in same director and be the name of the string below
                BufferedReader in = new BufferedReader(new FileReader("files/FLAT.txt"));
                String str;
                while ((str = in.readLine()) != null) {
                   //System.out.println(str.length());
                   lineProcessed[i] = parseThatLine(str);
                   i++;
                in.close();
                 catch (IOException e) {}     
                //write out the lineProcess[] array to another file
             writeThatFile(lineProcessed);
          }//end loadFixedWidthFile()
           public void writeThatFile(String[] s){
             try {
                BufferedWriter out = new BufferedWriter(new FileWriter("files/outfilename.txt"));
                for(int i = 0; i < s.length -1; i++){
                   out.write(s);
    }//end for loop
    out.close();
    catch (IOException e) {}
    }//end writeThatFile
    public String parseThatLine(String s){
    int start = 0;
    int end = 0;
    String parsedLine = "";
    int numChars = getFldSizeArray().length;
    //Print number of lines for testing
    //System.out.println(numChars);
    String[] oArray = getFldSizeArray();
    //String chars = oArray[0];
    //System.out.println(chars.length());
    //oArray
    for(int i = 0; i < numChars -1; i++ ){
    if(i == 0){
    start = 0;
    end = end + Integer.parseInt(oArray[i])-1;
    else
    start = end;
    end = end + Integer.parseInt(oArray[i]);
    parsedLine = parsedLine + s.substring(start, end) + "~";
    }//end for loop
    return parsedLine;
    }//End of parseThatLine
    I have tried to illeminate as many arrays as I can thinking that was chewing up the memory but to no avail.
    Any thoughts or ideas?
    Message was edited by:
    SaipanMan2005

    You should not keep a String array of all the lines of the file read.
    Instead for each line read, parse it, then write the parsed line in the other file:      public void loadFixedWidthFile() {
             BufferedReader in = null;
             BufferedWriter out = null;
             try {
                //File must be in same director and be the name of the string below
                in = new BufferedReader(new FileReader("files/FLAT.txt"));
                out = new BufferedWriter(new FileWriter("files/outfilename.txt"));
                String str;
                while ((str = in.readLine()) != null) {
                   //System.out.println(str.length());
                   str = parseThatLine(str);
                   //write out the parsed str to another file
                   out.write(str);
             catch (IOException e) {
                e.printStackTrace(); // At least print the exception - never swallow an exception
             finally { // Use a finally block to be sure of closing the files even when exception occurs
                try { in.close(); }
                catch (Exception e) {}
                try { out.close(); }
                catch (Exception e) {}
          }//end loadFixedWidthFile()Regards

Maybe you are looking for

  • Access privileges denied

    alright maybe i'm missing something but i can't import cds because it says my music folder doesn't have the permission. it then tells me to check and for the life of me i can't find any setting with access rights. i could use some help.

  • Dynamically Change Company Logo

    I want to create one form used by both of our companies. When the user selects their location, the cooresponding company logo displays at the top of the form including all new pages generated. I was able to get this working with JavaScript but ran in

  • Inserting addition field in ABAP query (SQ01) while generating reports.

    Please let me know the procedure of adding field and applying mathematical  formula in the query.

  • Global Index on several partitions with each partition on different servers

    Hi, I have a table divided into 4 partitions. Each partition is on a different server. Currenlty the indexes are set per partition. I would like to create a global index which would work on all partitions. How could I create global index which will w

  • Convert my web service to processus Bpel graphically

    Hi, Can you suggest me an article or I can turn my web service to BPEL graphically, because I have complicated web of service and I am just starting out in BPEL.I use ORACLE BPEL MANAGER with JDEVELOPER. Best regards,