Announcement Announcement Module
Collapse
No announcement yet.
FTP inbound - java.lang.OutOfMemoryError Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FTP inbound - java.lang.OutOfMemoryError

    Hi,

    I've created a FTP inbound channel adapter, that reads from a FTP. It uses the transaction described at https://jira.springsource.org/browse/INT-1849 - with a minor modification: instead of always doing "registerSynchronization", I've also added a "clearSynchronization". So it looks like this:

    Code:
    	@Override
    	public Message<?> preSend(Message<?> message, MessageChannel channel) {
    		if (!(message.getPayload() instanceof File)){ 
    			throw new RuntimeException("PostCommitFileDeletionChannelInterceptor can only be used for messages with payload of type File"); 
    		}
    		this.synchronization.setFile((File) message.getPayload());
    		TransactionSynchronizationManager.clearSynchronization();
    		TransactionSynchronizationManager.registerSynchronization(synchronization);
    		return super.preSend(message, channel);
    	}
    I've deployed the application to a server running Weblogic 10.3.3.0 and set the poller to 1s. I've let it run, polling the FTP, for a couple of days without any files. After a while, I get:

  • #2
    #2

    [QUOTE][2011-05-05 04:38:52,498, DEBUG, AbstractPlatformTransactionManager.java:925] - Triggering beforeCommit synchronization
    [2011-05-05 04:38:56,389, DEBUG, AbstractPlatformTransactionManager.java:938] - Triggering beforeCompletion synchronization
    [2011-05-05 04:38:57,604, DEBUG, AbstractPlatformTransactionManager.java:752] - Initiating transaction commit
    [2011-05-05 04:38:57,604, DEBUG, AbstractPlatformTransactionManager.java:951] - Triggering afterCommit synchronization
    [2011-05-05 04:38:58,751, DEBUG, AbstractPlatformTransactionManager.java:967] - Triggering afterCompletion synchronization
    [2011-05-05 04:38:59,860, DEBUG, TransactionSynchronizationManager.java:316] - Clearing transaction synchronization
    [2011-05-05 04:39:03,632, DEBUG, AbstractPlatformTransactionManager.java:365] - Creating new transaction with name [org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
    [2011-05-05 04:39:04,937, DEBUG, TransactionSynchronizationManager.java:258] - Initializing transaction synchronization
    [2011-05-05 04:39:12,688, DEBUG, TransactionAspectSupport.java:362] - Getting transaction for [org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call]
    [2011-05-05 04:39:14,027, DEBUG, CachingSessionFactory.java:77] - Using session from the pool
    [2011-05-05 04:39:16,775, DEBUG, CachingSessionFactory.java:116] - Releasing target session back to the pool
    [2011-05-05 04:39:18,019, DEBUG, TransactionAspectSupport.java:391] - Completing transaction for [org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call]
    [2011-05-05 04:39:19,121, DEBUG, AbstractPlatformTransactionManager.java:925] - Triggering beforeCommit synchronization
    [2011-05-05 04:39:21,943, DEBUG, AbstractPlatformTransactionManager.java:938] - Triggering beforeCompletion synchronization
    [2011-05-05 04:39:24,515, DEBUG, AbstractPlatformTransactionManager.java:752] - Initiating transaction commit
    [2011-05-05 04:39:24,515, DEBUG, AbstractPlatformTransactionManager.java:951] - Triggering afterCommit synchronization
    [2011-05-05 04:39:26,174, DEBUG, AbstractPlatformTransactionManager.java:967] - Triggering afterCompletion synchronization
    [2011-05-05 04:39:26,174, DEBUG, TransactionSynchronizationManager.java:316] - Clearing transaction synchronization
    [2011-05-05 04:39:29,509, DEBUG, AbstractPlatformTransactionManager.java:365] - Creating new transaction with name [org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call]: PROPAGATION_REQUIRED,ISOLATION_DEFAULTint.Abstract PollingEndpoint$1.call]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
    [2011-05-05 04:39:40,252, DEBUG, AbstractMessageChannel.java:224] - preSend on channel 'errorChannel', message: [Payload=java.lang.OutOfMemoryError: allocLargeObjectOrArray: [C, size 6504][Headers={timestamp=1304563180252, id=e6e5c38c-660f-43bb-a3db-90eae44aec89}]
    [2011-05-05 04:40:26,502, WARN , MessagePublishingErrorHandler.java:91] - Error message was not delivered.
    java.lang.OutOfMemoryError: allocLargeObjectOrArray: [B, size 5800
    at java.util.jar.Attributes.read(Attributes.java:377)
    at java.util.jar.Manifest.read(Manifest.java:182)
    at java.util.jar.Manifest.<init>(Manifest.java:52)
    at java.util.jar.JarFile.getManifestFromReference(Jar File.java:165)
    at java.util.jar.JarFile.getManifest(JarFile.java:146 )
    at weblogic.utils.classloaders.JarSource.getManifest( JarSource.java:21)
    at weblogic.utils.classloaders.GenericClassLoader.def ineClass(GenericClassLoader.java:304)
    at weblogic.utils.classloaders.GenericClassLoader.fin dLocalClass(GenericClassLoader.java:285)
    at weblogic.utils.classloaders.GenericClassLoader.fin dClass(GenericClassLoader.java:253)
    at weblogic.utils.classloaders.ChangeAwareClassLoader .findClass(ChangeAwareClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 03)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
    at weblogic.utils.classloaders.GenericClassLoader.loa dClass(GenericClassLoader.java:177)
    at weblogic.utils.classloaders.ChangeAwareClassLoader .loadClass(ChangeAwareClassLoader.java:37)
    at org.springframework.integration.util.MessagingMeth odInvokerHelper.process(MessagingMethodInvokerHelp er.java:122)
    at org.springframework.integration.handler.MethodInvo kingMessageProcessor.processMessage(MethodInvoking MessageProcessor.java:73)
    at org.springframework.integration.handler.MethodInvo kingMessageHandler.handleMessage(MethodInvokingMes sageHandler.java:57)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.doDispatch(UnicastingDispatcher.java :110)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.dispatch(UnicastingDispatcher.java:9 7)
    at org.springframework.integration.channel.AbstractSu bscribableChannel.doSend(AbstractSubscribableChann el.java:44)
    at org.springframework.integration.channel.AbstractMe ssageChannel.send(AbstractMessageChannel.java:157)
    at org.springframework.integration.channel.MessagePub lishingErrorHandler.handleError(MessagePublishingE rrorHandler.java:83)
    at org.springframework.integration.util.ErrorHandling TaskExecutor$1.run(ErrorHandlingTaskExecutor.java: 55)
    at org.springframework.core.task.SyncTaskExecutor.exe cute(SyncTaskExecutor.java:48)
    at org.springframework.integration.util.ErrorHandling TaskExecutor.execute(ErrorHandlingTaskExecutor.jav a:49)
    at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller.run(AbstractPollingEndpoint. java:201)
    at org.springframework.scheduling.support.DelegatingE rrorHandlingRunnable.run(DelegatingErrorHandlingRu nnable.java:51)
    at org.springframework.scheduling.concurrent.Reschedu lingRunnable.run(ReschedulingRunnable.java:81)
    at java.util.concurrent.Executors$RunnableAdapter.cal l(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.jav a:138)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.access$301(ScheduledThreadPoolE xecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.run(ScheduledThreadPoolExecutor .java:207)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)

    Comment


    • #3
      #3

      [/QUOTE]
      [2011-05-05 04:40:33,443, ERROR, MessagePublishingErrorHandler.java:102] - failure occurred in messaging task
      java.lang.OutOfMemoryError: allocLargeObjectOrArray: [C, size 6504
      at java.util.Arrays.copyOfRange(Arrays.java:3209)
      at java.lang.String.<init>(String.java:215)
      at java.lang.StringBuffer.toString(StringBuffer.java: 585)
      at java.io.StringWriter.toString(StringWriter.java:19 3)
      at org.apache.log4j.spi.LocationInfo.<init>(LocationI nfo.java:97)
      at org.apache.log4j.spi.LoggingEvent.getLocationInfor mation(LoggingEvent.java:182)
      at org.apache.log4j.helpers.PatternParser$LocationPat ternConverter.convert(PatternParser.java:475)
      at org.apache.log4j.helpers.PatternConverter.format(P atternConverter.java:56)
      at org.apache.log4j.PatternLayout.format(PatternLayou t.java:495)
      at org.apache.log4j.WriterAppender.subAppend(WriterAp pender.java:292)
      at org.apache.log4j.WriterAppender.append(WriterAppen der.java:150)
      at org.apache.log4j.AppenderSkeleton.doAppend(Appende rSkeleton.java:221)
      at org.apache.log4j.helpers.AppenderAttachableImpl.ap pendLoopOnAppenders(AppenderAttachableImpl.java:57 )
      at org.apache.log4j.Category.callAppenders(Category.j ava:194)
      at org.apache.log4j.Category.forcedLog(Category.java: 379)
      at org.apache.log4j.Category.log(Category.java:844)
      at org.apache.commons.logging.impl.Log4JLogger.trace( Log4JLogger.java:152)
      at org.springframework.transaction.support.Transactio nSynchronizationManager.initSynchronization(Transa ctionSynchronizationManager.java:258)
      at org.springframework.transaction.support.AbstractPl atformTransactionManager.prepareSynchronization(Ab stractPlatformTransactionManager.java:536)
      at org.springframework.transaction.support.AbstractPl atformTransactionManager.getTransaction(AbstractPl atformTransactionManager.java:372)
      at org.springframework.transaction.interceptor.Transa ctionAspectSupport.createTransactionIfNecessary(Tr ansactionAspectSupport.java:335)
      at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:105)
      at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
      at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
      at $Proxy51.call(Unknown Source)
      at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller$1.run(AbstractPollingEndpoin t.java:206)
      at org.springframework.integration.util.ErrorHandling TaskExecutor$1.run(ErrorHandlingTaskExecutor.java: 52)
      at org.springframework.core.task.SyncTaskExecutor.exe cute(SyncTaskExecutor.java:48)
      at org.springframework.integration.util.ErrorHandling TaskExecutor.execute(ErrorHandlingTaskExecutor.jav a:49)
      at org.springframework.integration.endpoint.AbstractP ollingEndpoint$Poller.run(AbstractPollingEndpoint. java:201)
      at org.springframework.scheduling.support.DelegatingE rrorHandlingRunnable.run(DelegatingErrorHandlingRu nnable.java:51)
      at org.springframework.scheduling.concurrent.Reschedu lingRunnable.run(ReschedulingRunnable.java:81)
      at java.util.concurrent.Executors$RunnableAdapter.cal l(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.jav a:138)
      at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.access$301(ScheduledThreadPoolE xecutor.java:98)
      at java.util.concurrent.ScheduledThreadPoolExecutor$S cheduledFutureTask.run(ScheduledThreadPoolExecutor .java:207)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
      [2011-05-05 04:40:39,876, DEBUG, AbstractPlatformTransactionManager.java:470] - Participating in existing transaction
      [2011-05-05 04:40:45,375, DEBUG, TransactionSynchronizationManager.java:258] - Initializing transaction synchronization
      [2011-05-05 04:41:01,848, DEBUG, TransactionAspectSupport.java:362] - Getting transaction for [org.springframework.integration.endpoint.AbstractP ollingEndpoint$1.call]
      [WARN ][thread ] dispatchUncaughtException
      java/lang/OutOfMemoryError:
      at jrockit/vm/Reflect.fillInStackTrace0(Ljava/lang/ThrowableV(Native Method)
      at java/lang/Throwable.fillInStackTrace()Ljava/lang/Throwable;(Native Method)
      at java/lang/Throwable.<init>(Throwable.java:196)
      at java/lang/Error.<init>(Error.java:49)
      at java/lang/VirtualMachineError.<init>(VirtualMachineError.jav a:35)
      at java/lang/OutOfMemoryError.<init>(OutOfMemoryError.java:35)
      at jrockit/vm/RNI.c2java(IIIII)V(Native Method)
      --- End of stack trace
      [2011-05-05 04:42:41,017, WARN , MessagePublishingErrorHandler.java:91] - Error message was not delivered.
      java.lang.OutOfMemoryError
      Exception in thread "[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'" java.lang.OutOfMemoryError
      Exception in thread "weblogic.timers.TimerThread" java.lang.OutOfMemoryError: getNewTla
      at java.util.ResourceBundle$Control.newBundle(Resourc eBundle.java:2428)
      at java.util.ResourceBundle.loadBundle(ResourceBundle .java:1406)
      at java.util.ResourceBundle.findBundle(ResourceBundle .java:1365)
      at java.util.ResourceBundle.findBundle(ResourceBundle .java:1292)
      at java.util.ResourceBundle.findBundle(ResourceBundle .java:1292)
      at java.util.ResourceBundle.getBundleImpl(ResourceBun dle.java:1234)
      at java.util.ResourceBundle.getBundle(ResourceBundle. java:962)
      at weblogic.i18ntools.L10nLookup.getLocalizerBundle_i nner(L10nLookup.java:510)
      at weblogic.i18ntools.L10nLookup.getLocalizerBundle(L 10nLookup.java:447)
      at weblogic.i18ntools.L10nLookup.getLocalizer(L10nLoo kup.java:408)
      at weblogic.i18n.logging.CatalogMessage.<init>(Catalo gMessage.java:48)
      at weblogic.work.WorkManagerLogger.logScheduleFailed( WorkManagerLogger.java:267)
      at weblogic.work.SelfTuningWorkManagerImpl.schedule(S elfTuningWorkManagerImpl.java:155)
      at weblogic.timers.internal.TimerManagerFactoryImpl$W orkManagerExecutor.execute(TimerManagerFactoryImpl .java:132)
      at weblogic.timers.internal.TimerManagerImpl.execute( TimerManagerImpl.java:632)
      at weblogic.timers.internal.TimerThread$Thread.run(Ti merThread.java:272)
      [2011-05-05 04:42:44,099, ERROR, MessagePublishingErrorHandler.java:102] - failure occurred in messaging task
      [2011-05-05 04:43:31,357, DEBUG, AbstractMessageChannel.java:224] - preSend on channel 'errorChannel', message: [Payload=java.lang.OutOfMemoryError: getNewTla][Headers={timestamp=1304563410135, id=ca2bcfdd-c31c-4835-b3c0-b3205a2554eb}]
      <May 5, 2011 4:43:39 AM CEST> <Warning> <RMI> <BEA-080004> <An error was thrown by rmi server: Throwable was thrown and ignored while executing: weblogic
      .jms.frontend.FEConnectionFactoryImpl.connectionCr eateRequest(Lweblogic.jms.frontend.FEConnectionCre ateRequest
      java.lang.OutOfMemoryError.
      java.lang.OutOfMemoryError
      >
      <May 5, 2011 4:44:09 AM CEST> <Error> <Kernel> <BEA-000802> <ExecuteRequest failed
      java.lang.OutOfMemoryError.
      java.lang.OutOfMemoryError
      >
      Exception in thread "[STANDBY] ExecuteThread: '9' for queue: 'weblogic.kernel.Default (self-tuning)'" java.lang.OutOfMemoryError
      <May 5, 2011 4:44:15 AM CEST> <Error> <Server> <BEA-002608> <The ListenThread because of an error: java.lang.OutOfMemoryError
      java.lang.OutOfMemoryError
      >
      [/QUOTE]

      Comment


      • #4
        Well, the error seem to happen when your system is trying to log something that is very very large causing OutOfMemoryError
        Code:
        java.lang.OutOfMemoryError: allocLargeObjectOrArray: [C, size 6504
        at java.util.Arrays.copyOfRange(Arrays.java:3209)
        at java.lang.String.<init>(String.java:215)
        at java.lang.StringBuffer.toString(StringBuffer.java: 585)
        at java.io.StringWriter.toString(StringWriter.java:19 3)
        at org.apache.log4j.spi.LocationInfo.<init>(LocationI nfo.java:97)
        at org.apache.log4j.spi.LoggingEvent.getLocationInfor mation(LoggingEvent.java:182)
        at org.apache.log4j.helpers.PatternParser$LocationPat ternConverter.convert(PatternParser.java:475)
        at org.apache.log4j.helpers.PatternConverter.format(P atternConverter.java:56)
        at org.apache.log4j.PatternLayout.format(PatternLayou t.java:495)
        at org.apache.log4j.WriterAppender.subAppend(WriterAp pender.java:292)
        at org.apache.log4j.WriterAppender.append(WriterAppen der.java:150)
        at org.apache.log4j.AppenderSkeleton.doAppend(Appende rSkeleton.java:221)
        at org.apache.log4j.helpers.AppenderAttachableImpl.ap pendLoopOnAppenders(AppenderAttachableImpl.java:57 )
        at org.apache.log4j.Category.callAppenders(Category.j ava:194)
        at org.apache.log4j.Category.forcedLog(Category.java: 379)
        at org.apache.log4j.Category.log(Category.java:844)
        . . .
        The good thing is that OME seems to be handled nicely by JRockit without crashing JVM thus allowing the process to proceed. That is how it ends up going through ErrorHandlingTaskExecutor which creates an ErrorMessage and sends it to the error-channel. The ErrorMessage payload is OutOfMemoryError:
        Code:
        [2011-05-05 04:39:40,252, DEBUG, AbstractMessageChannel.java:224] - preSend on channel 'errorChannel', message: [Payload=java.lang.OutOfMemoryError: allocLargeObjectOrArray: [C, size 6504][Headers={timestamp=1304563180252, id=e6e5c38c-660f-43bb-a3db-90eae44aec89}]
        What do you think your system might be logging that is so large?

        Comment


        • #5
          There shouldn't be any thing out of the ordinary logging at that moment. I've let the service poll (every second) an empty FTP service and had it running for a couple of days - then I get that kind of message. So, the only thing I log is the: debug-messages on springframework (the first Debug-messages you see from my first post). I've tested it several times (just polling an empty FTP service for a long time), all with the same results. Tested it with both Weblogic and Jetty as application server. So, I think that it might be something else - maybe my transactionHandler?

          Comment

          Working...
          X