I have a server app with a timer that runs every 15 seconds. It runs fine for several days and then after a period of time it throws the error below.
I dont see any excess CPU/Memory being used so its not a memory leak etc and the strange thing is that this doesnt happen on WIndows just on my Linux machines.
Any ideas?
There is nothing tricky in the code
I dont see any excess CPU/Memory being used so its not a memory leak etc and the strange thing is that this doesnt happen on WIndows just on my Linux machines.
Any ideas?
B4X:
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4j.object.JServlet.createInstance(JServlet.java:62)
at anywheresoftware.b4j.object.BackgroundWorkersManager$1.run(BackgroundWorkersManager.java:21)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: java.lang.StackOverflowError
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:138)
at anywheresoftware.b4a.objects.Timer$TickTack$1.run(Timer.java:135)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:47)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:43)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:175)
at nz.ope.qonda.monitor.agent.bkg_collect_procinfo._initialize(bkg_collect_procinfo.java:521)
... 7 more
There is nothing tricky in the code
B4X:
Public Sub Initialize
ClassName = g.GetClassName(Me)
priorSnapshotMap.Initialize
timer1.Initialize("timer1", 15000) ' Every 15 seconds
timer1.Enabled = True
StartMessageLoop '<- don't forget!
End Sub
Sub Timer1_Tick
Logger.Debug("Background - " & ClassName)
If Main.state <> "running" Then Return
timer1.Enabled = False
Collect ' This does the actual work and has a try/catch block around that code
timer1.Enabled = True
End Sub