Leak Memory Error

75 views
Skip to first unread message

Claudia Roberta

unread,
Sep 13, 2023, 1:18:52 PM9/13/23
to sakai-dev
Hi guys!

Since yesterday, I'm having the following error when uploading Tomcat:

12-Sep-2023 21:29:44.140 GRAVE [main] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
12-Sep-2023 21:29:44.143 GRAVE [main] org.apache.catalina.core.StandardContext.startInternal Context [/sakai-onedrive-tool] startup failed due to previous errors
12-Sep-2023 21:29:44.154 ADVERTÊNCIA [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [sakai-onedrive-tool] appears to have started a thread named [boot precache users] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java...@11.0.18/java.lang.Object.wait(Native Method)
 java...@11.0.18/java.lang.Object.wait(Object.java:328)
 java...@11.0.18/java.util.TimerThread.mainLoop(Timer.java:527)
 java...@11.0.18/java.util.TimerThread.run(Timer.java:506)
12-Sep-2023 21:29:44.169 ADVERTÊNCIA [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [sakai-onedrive-tool] appears to have started a thread named [daily precache users] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java...@11.0.18/java.lang.Object.wait(Native Method)
 java...@11.0.18/java.lang.Object.wait(Object.java:328)
 java...@11.0.18/java.util.TimerThread.mainLoop(Timer.java:527)
 java...@11.0.18/java.util.TimerThread.run(Timer.java:506)
12-Sep-2023 21:29:44.170 ADVERTÊNCIA [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [sakai-onedrive-tool] appears to have started a thread named [org.azeckoski.reflectutils.refmap.Finalizer] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java...@11.0.18/java.lang.Object.wait(Native Method)
 java...@11.0.18/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:155)
 java...@11.0.18/java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:176)
 org.azeckoski.reflectutils.refmap.Finalizer.run(Finalizer.java:127)
12-Sep-2023 21:29:44.170 ADVERTÊNCIA [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [sakai-onedrive-tool] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java...@11.0.18/java.lang.Object.wait(Native Method)
 java...@11.0.18/java.util.TimerThread.mainLoop(Timer.java:553)
 java...@11.0.18/java.util.TimerThread.run(Timer.java:506)
12-Sep-2023 21:29:44.171 ADVERTÊNCIA [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [sakai-onedrive-tool] appears to have started a thread named [SakaiPresenceService.Maintenance] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java...@11.0.18/java.lang.Thread.sleep(Native Method)
 org.sakaiproject.presence.impl.BasePresenceService$Maintenance.run(BasePresenceService.java:794)
 java...@11.0.18/java.lang.Thread.run(Thread.java:829)
12-Sep-2023 21:29:44.171 ADVERTÊNCIA [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [sakai-onedrive-tool] appears to have started a thread named [Sakai.SessionComponent.Maintenance] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java...@11.0.18/java.lang.Thread.sleep(Native Method)
 org.sakaiproject.tool.impl.SessionComponent$Maintenance.run(SessionComponent.java:600)
 java...@11.0.18/java.lang.Thread.run(Thread.java:829)
12-Sep-2023 21:29:44.172 ADVERTÊNCIA [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [sakai-onedrive-tool] appears to have started a thread named [helpCP housekeeper] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java...@11.0.18/jdk.internal.misc.Unsafe.park(Native Method)
 java...@11.0.18/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
 java...@11.0.18/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)
 java...@11.0.18/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
 java...@11.0.18/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
 java...@11.0.18/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
 java...@11.0.18/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
 java...@11.0.18/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 java...@11.0.18/java.lang.Thread.run(Thread.java:829)
12-Sep-2023 21:29:44.173 ADVERTÊNCIA [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [sakai-onedrive-tool] appears to have started a thread named [helpCP connection adder] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java...@11.0.18/jdk.internal.misc.Unsafe.park(Native Method)
 java...@11.0.18/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
 java...@11.0.18/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)
 java...@11.0.18/java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:458)
 java...@11.0.18/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1053)
 java...@11.0.18/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
 java...@11.0.18/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
 java...@11.0.18/java.lang.Thread.run(Thread.java:829)
12-Sep-2023 21:29:44.184 INFORMAÇÕES [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/apache-tomcat-9.0.73/webapps/sakai-onedrive-tool.war] has finished in [56.355] ms


I'm using Sakai 22.2, Apache Tomcat/9.0.73, Linux 5.10.0-21-amd64 and java-11-openjdk-amd64. Can anyone help me?

Tks,

--
Claudia Moraes
Larc - Laboratório de Arquitetura e Redes de Computadores


Markus Stetschnig

unread,
Sep 14, 2023, 4:10:47 AM9/14/23
to Claudia Roberta, sakai-dev
Hi Claudia!
It looks like there might be more previous errors on startup that were causing this, could you share them if they are present?
--
-----------------------------------------------
Markus Stetschnig
Software Developer at EDF

Website: https://www.edf.global
LinkedIn: https://es.linkedin.com/company/entornosdeformacion
Office Phone: +34 - 96 381 35 75
-----------------------------------------------

Su dirección de correo electrónico junto a sus datos personales consta en un fichero cuya finalidad es la de mantener el contacto profesional con Ud. Por ENTORNOS DE FORMACIÓN S.L., como responsable del Fichero y del Tratamiento. De conformidad con el Reglamento (UE) núm. 2016/679, General de Protección de Datos y la LO 3/2018, de 5 de diciembre, de Protección de Datos Personales y garantía de los derechos digitales, puede ejercer de forma totalmente gratuita los derechos de acceso, información, rectificación, supresión y olvido, limitación del tratamiento, oposición, portabilidad y a no ser objeto de decisiones individuales automatizadas enviando un correo electrónica a la siguiente dirección: in...@edf.global Si no desea recibir información por correo electrónico notifiquenoslo en esta misma dirección. Aviso sobre confidencialidad: Este documento se dirige exclusivamente a su destinatario. Por contener información confidencial, sometida a secreto profesional cuya divulgación está prohibida en virtud de la legislación vigente. Se informa a quien lo recibiera, sin ser el destinatario, que la información contenida en el mismo es reservada y su utilización con cualquier fin está prohibida. Si ha recibido este documento por error, le rogamos nos lo comunique y proceda a su destrucción.

Your e-mail address and your data are stored in a file to maintain professional contact between you and ENTORNOS DE FORMACIÓN S.L., as the party responsible for the file and the processing. In accordance with Regulation (EU) No. 2016/679, General Data Protection and the OL 3/2018 of 5th December, to guarantee digital rights, you can exercise free of charge the rights of access, information, rectification, deletion and oblivion, limitation of processing, opposition, portability and the right of you are not subject to automated individual decisions, by sending an e-mail to the following address: in...@edf.global. If you do not wish to receive information by e-mail, please notify us at the same address. Confidentiality notice: This document is addressed exclusively to the addressee. If you have received this document in error, please inform us and destroy it.


--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/sakai-dev/CAAfBv%3DSAb0aADz3J6wPE_VWCK2wj4vLFPC9%3DLWhtZjg%3DyueCPg%40mail.gmail.com.

Hendrik Steller

unread,
Sep 14, 2023, 5:39:57 AM9/14/23
to Claudia Roberta, sakai-dev
Hi,

those look like Tomcat's warnings about potential (classloader-)memory leaks
when redeploying a webapp (sakai-onedrive-tool.war).
If you have a webapp that starts background threads and don't include code to
stop those threads when the webapp gets undeployed, then afterwards there
might still be references around to the classes and objects from that
deployment which can't be garbage collected.

That means if you re-deploy that webapp a lot without restarting Tomcat, there
might be old, unused objects from previous deployments piling up.
To get rid of that garbage, you would have to restart Tomcat.

So if
a) Tomcat got it right ("_appears_ to have started, but failed to stop..")
and
b) you re-deploy that webapp _a_lot_(!) without restarting tomcat in between
and/or those uncollectable objects are really, really big

then you might eventually run out of memory after one of those re-deployments.

I don't know about you, but outside of hotfixes I rarely re-deploy single sakai
webapps in production without restarting tomcat, because if those updates
involve components/services or api packages outside of the webapp
(classloader), you will have to restart tomcat anyway for the changes to take
effect.

So I wouldn't worry too much about those messages unless you redeploy this
webapp _a_lot_ between tomcat restarts. And then a Tomcat restart would "fix"
this.
(Well, the actual fix would be for the webapp to do proper housekeeping, but as
said before, given Sakai's special structure with all the stuff deployed to
tomcat/lib and components, it shouldn't happen that often that one redeploys
webapps in production without restarting tomcat).


Regards,
Hendrik

Claudia Roberta

unread,
Sep 14, 2023, 7:16:19 AM9/14/23
to Hendrik Steller, mstet...@entornosdeformacion.com, sakai-dev
Hi guys!

I appreciate the responses.
In fact, I stop the Tomcat service, compile using Maven and start the Tomcat service again.
The Sakai platform has many tools. I tried disabling the OneDrive project, but the same error happened to another tool.
From what I researched about this error, I suspect it is something related to caching.
So, Hendrik's answer made sense to me. But, the problem is the number of tools. I wasn't even working on the OneDrive project when the error started. I was working on the Wiki.

As Marcus requested, the full error is attached.
If you can help me, I would appreciate it.
Regards,

Claudia





> I'm using Sakai 22.2, Apache Tomcat/9.0.73, Linux 5.10.0-21-amd64 and
> java-11-openjdk-amd64. Can anyone help me?
>
> Tks,




catalina.2023-09-12-ERROR

Miguel Pellicer

unread,
Sep 14, 2023, 9:26:08 AM9/14/23
to Claudia Roberta, Hendrik Steller, mstet...@entornosdeformacion.com, sakai-dev

The stdout file will give you more information, it is not related to the one-drive project.

--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
Office Phone: +34 - 96 381 35 75
Request a meeting here: https://calendly.com/mpellicer

Claudia Roberta

unread,
Sep 14, 2023, 10:16:38 AM9/14/23
to Miguel Pellicer, Hendrik Steller, mstet...@entornosdeformacion.com, sakai-dev
Hi!
I appreciate your response!
We aren't interested in using the OneDrive tool, I disabled it. When I did this, the error was repeated:

14-Sep-2023 09:41:42.958 GRAVE [main] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
14-Sep-2023 09:41:42.962 GRAVE [main] org.apache.catalina.core.StandardContext.startInternal Context [/commons-tool] startup failed due to previous errors
14-Sep-2023 09:41:42.983 ADVERTÊNCIA [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [commons-tool] appears to have started a thread named [boot precache users] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:

Any idea?

Regards,

Claudia

Markus Stetschnig

unread,
Sep 14, 2023, 11:26:30 AM9/14/23
to Claudia Roberta, Miguel Pellicer, Hendrik Steller, sakai-dev
Do you have a catalina.out file at /opt/apache-tomcat-9.0.73/logs?

Markus

Claudia Roberta

unread,
Sep 14, 2023, 4:05:43 PM9/14/23
to Markus Stetschnig, Miguel Pellicer, Hendrik Steller, sakai-dev
Hi guys!

Markus,

Yes, I do.
I'm sending attached.
The work directory is cleaned, the previous months' logs are deleted and the MySQL server is restarted.
These procedures were recommended on a forum.
See the output
with the tail command in attached.

Any idea?

Regards,

Claudia



command-tail.txt
catalina.2023-09-14.log
Reply all
Reply to author
Forward
0 new messages