B4J Question [Web] web server crashed

Jones Hone

Active Member
Licensed User
Longtime User
I have a web server (is installed on Oracle Cloud Free Tier, The operating system is ubuntu 20.04)
All web page functions are normal and can be executed!
But the following message will appear once every minute.
I found that the memory will be used all the time, after about 30 days,
Memory out appears, and then the web server crashes!
After shutting down the web server and restarting it,
everything started again, and it crashed again about 30 days later!

I can't find out why this is happening!
From this message, does anyone know what could be the cause?

B4X:
2024-02-04 15:36:11.472:INFO :oejs.AbstractConnector:main: Started ServerConnector@769f71a9{HTTP/1.1, (http/1.1)}{0.0.0.0:80}
2024-02-04 15:36:11.503:INFO :oejus.SslContextFactory:main: x509=X509@23941fb4(1,h=[hungcy.com, www.hungcy.com],a=[],w=[]) for Server@1f9f6368[provider=null,keyStore=file:///home/ubuntu/b4jwebhook/certs/jetty.keystore,trustStore=null]
2024-02-04 15:36:11.568:INFO :oejs.AbstractConnector:main: Started ServerConnector@72f926e6{SSL, (ssl, http/1.1)}{0.0.0.0:443}
2024-02-04 15:36:11.588:INFO :oejs.Server:main: Started Server@3857f613{STARTING}[11.0.9,sto=0] @851ms
Server started
==========The following message will appear every approximately 1 minute========
java.net.SocketTimeoutException: connect timed out
    at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
    at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
    at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
    at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.base/java.net.Socket.connect(Socket.java:609)
    at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:120)
    at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:295)
    at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)
    at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
    at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
    at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
    at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
    at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
    at anywheresoftware.b4h.okhttp.OkHttpClientWrapper.executeWithTimeout(OkHttpClientWrapper.java:175)
    at anywheresoftware.b4h.okhttp.OkHttpClientWrapper.access$0(OkHttpClientWrapper.java:172)
    at anywheresoftware.b4h.okhttp.OkHttpClientWrapper$ExecuteHelper.run(OkHttpClientWrapper.java:220)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

The following is the message when the web server crashes:
B4X:
Reported exception:
java.lang.OutOfMemoryError: Java heap space
2024-02-03 06:44:20.158:WARN :oejut.QueuedThreadPool:qtp1221555852-13: Job failed
java.lang.OutOfMemoryError: Java heap space
2024-02-03 06:43:48.575:WARN :oeji.ManagedSelector:qtp1221555852-25998: Could not accept [FAILED toString()]: java.lang.OutOfMemoryError: Java heap space
2024-02-03 06:44:28.460:WARN :oeji.ManagedSelector:qtp1221555852-26002: Could not accept java.nio.channels.SocketChannel[closed]: java.lang.OutOfMemoryError: Java heap space
2024-02-03 07:04:46.277:WARN :oeji.ManagedSelector:qtp1221555852-26006: Could not accept java.nio.channels.SocketChannel[closed]: java.lang.OutOfMemoryError: Java heap space
2024-02-03 07:17:55.758:WARN :oeji.ManagedSelector:qtp1221555852-26007: Could not accept java.nio.channels.SocketChannel[closed]: java.lang.OutOfMemoryError: Java heap space

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "qtp1221555852-25993"

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "qtp1221555852-26008"
2024-02-03 07:39:47.064:WARN :oejut.ReservedThreadExecutor:qtp1221555852-25962: Unable to run task
java.lang.OutOfMemoryError: Java heap space

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "qtp1221555852-12"
java.lang.OutOfMemoryError: Java heap space
 
Top