tufanv Expert Licensed User Longtime User Apr 14, 2020 #1 Hello, I started getting an error after using the websocket for sometime without problem. The error happens on ws.Connect("wss://websocket.xx.com/websocket"); before connecting I set these: B4X: Copy ws.Initialize("ws") Dim jo As JavaObject = ws jo = jo.GetField("wsc") jo = jo.RunMethod("getPolicy", Null) jo = jo.RunMethod("setMaxTextMessageSize", Array As Object (128000)) maybe messagesize is not enough ? My dedicated server has plenty of ram cpu etc, it is not related to machine itself. B4X: Copy main._vv4 (java line: 84) java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached at java.base/java.lang.Thread.start0(Native Method) at java.base/java.lang.Thread.start(Thread.java:803) at anywhersoftware.b4j.objects.WebSocketClientWrapper.Connect(WebSocketClientWrapper.java:63) at b4j.example.main._vv4(main.java:84) at b4j.example.main$ResumableSub_ws_closed.resume(main.java:672) at anywheresoftware.b4a.keywords.Common$2$1.run(Common.java:1018) at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30) at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26) at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:153) at b4j.example.main._appstart(main.java:65) 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.b4a.BA.raiseEvent2(BA.java:91) at anywheresoftware.b4a.BA.raiseEvent(BA.java:78) at b4j.example.main.main(main.java:28)
Hello, I started getting an error after using the websocket for sometime without problem. The error happens on ws.Connect("wss://websocket.xx.com/websocket"); before connecting I set these: B4X: Copy ws.Initialize("ws") Dim jo As JavaObject = ws jo = jo.GetField("wsc") jo = jo.RunMethod("getPolicy", Null) jo = jo.RunMethod("setMaxTextMessageSize", Array As Object (128000)) maybe messagesize is not enough ? My dedicated server has plenty of ram cpu etc, it is not related to machine itself. B4X: Copy main._vv4 (java line: 84) java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached at java.base/java.lang.Thread.start0(Native Method) at java.base/java.lang.Thread.start(Thread.java:803) at anywhersoftware.b4j.objects.WebSocketClientWrapper.Connect(WebSocketClientWrapper.java:63) at b4j.example.main._vv4(main.java:84) at b4j.example.main$ResumableSub_ws_closed.resume(main.java:672) at anywheresoftware.b4a.keywords.Common$2$1.run(Common.java:1018) at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30) at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26) at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:153) at b4j.example.main._appstart(main.java:65) 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.b4a.BA.raiseEvent2(BA.java:91) at anywheresoftware.b4a.BA.raiseEvent(BA.java:78) at b4j.example.main.main(main.java:28)
Erel B4X founder Staff member Licensed User Longtime User Apr 14, 2020 #2 It is not related to the message size. Does it happen after several days? Looks like a "thread leak". Maybe you are not closing the connections. Upvote 0
It is not related to the message size. Does it happen after several days? Looks like a "thread leak". Maybe you are not closing the connections.