Swissmade Well-Known Member Licensed User Longtime User Feb 16, 2015 #1 Hi all, I have a small Websocket Server where about 8 connections at the same time are made. To be sure that th web-page is updated all the time I have a refresh time of the web page set to 10 minutes. The Web-page disconnects and connects again after this time has reach. Now the problem. The Server start with a Memory usage from about 30mb and threads usage 27. Startup the server with this code below. Code: Copy #VirtualMachineArgs: -Xms128m -Xmx128m After a while the server reach more then this 128mb and I get a out of memory error. Threats are also go high to 400-500 threads So I have the idea that there still old unused connections busy with something. How can I delete this unused connections and free up my resources. Many thanks for help
Hi all, I have a small Websocket Server where about 8 connections at the same time are made. To be sure that th web-page is updated all the time I have a refresh time of the web page set to 10 minutes. The Web-page disconnects and connects again after this time has reach. Now the problem. The Server start with a Memory usage from about 30mb and threads usage 27. Startup the server with this code below. Code: Copy #VirtualMachineArgs: -Xms128m -Xmx128m After a while the server reach more then this 128mb and I get a out of memory error. Threats are also go high to 400-500 threads So I have the idea that there still old unused connections busy with something. How can I delete this unused connections and free up my resources. Many thanks for help
Erel B4X founder Staff member Licensed User Longtime User Feb 16, 2015 #2 The online example which is running on this server, was running for 4 months without any memory leak (I stopped it because the server was updated). You will need to post your project as it seems like you have created a leak somewhere. Upvote 0
The online example which is running on this server, was running for 4 months without any memory leak (I stopped it because the server was updated). You will need to post your project as it seems like you have created a leak somewhere.
Swissmade Well-Known Member Licensed User Longtime User Feb 16, 2015 #3 Erel said: you have created a leak somewhere Click to expand... I think I have found whats the problem. In the Module I had a timer and have not stop this when the socket is disconnected. The Timer is needed to update the time on the Web-page and to test some setting. If settings are changing the Web-page get updated. Every 1000ms. It seems, that this is still running in the Background. Is there an other way to run a timer in the WSmodule part without this problem?? Now I have disable the Timer the Server is running well for the last hours. Memory about 35 mb and threads about 35-40. If you still like I can send the Project. Upvote 0
Erel said: you have created a leak somewhere Click to expand... I think I have found whats the problem. In the Module I had a timer and have not stop this when the socket is disconnected. The Timer is needed to update the time on the Web-page and to test some setting. If settings are changing the Web-page get updated. Every 1000ms. It seems, that this is still running in the Background. Is there an other way to run a timer in the WSmodule part without this problem?? Now I have disable the Timer the Server is running well for the last hours. Memory about 35 mb and threads about 35-40. If you still like I can send the Project.
Erel B4X founder Staff member Licensed User Longtime User Feb 17, 2015 #4 Just make sure to disable the timer in the Disconnected event. Upvote 0
Swissmade Well-Known Member Licensed User Longtime User Feb 17, 2015 #5 Erel said: Just make sure to disable the timer in the Disconnected event Click to expand... Have done this. Thanks Erel Upvote 0
Erel said: Just make sure to disable the timer in the Disconnected event Click to expand... Have done this. Thanks Erel