Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Out of Memory
Sun, Mar 1 2020 11:41 PMPermanent Link

KimHJ

Comca Systems, Inc

I have a problem every Sunday, the Elevate Webserver crash with a Out of Memory error. What can I do to increase the memory allocated to the Webserver?

From serveral location is send out hundred of text messages and each message send is received by the webserver and the receiver of the SMS have to answer back which are send to the webserver as well. So with in a 30 minutes period 1000 request are send to the webserver.

Thanks,
Kim
Mon, Mar 2 2020 12:06 AMPermanent Link

KimHJ

Comca Systems, Inc

Just to add the cloud server running Windows Server 2012 have 2 Cores and 2GB, I just increased it to 4GB.

I don't know if that will help, my next option is 4 cores and 8GB, but that double the price of the Cloud server.

Kim
Mon, Mar 2 2020 3:56 AMPermanent Link

Matthew Jones

KimHJ wrote:

> I have a problem every Sunday, the Elevate Webserver crash with a Out of Memory error. What can I do to increase the memory allocated to the Webserver?
>
> From serveral location is send out hundred of text messages and each message send is received by the webserver and the receiver of the SMS have to answer back which are send to the webserver as well. So with in a 30 minutes period 1000 request are send to the webserver.

Okay, so you have it repeatable, which is always good. Two things for starters - you need to find out what the actual problem is. "Out of Memory" can mean you are actually out of memory (object storage), or, on Windows, it can mean you have exhausted the System Handle pool. The latter means you opened too many files, or sometimes GDI objects.

Either way, this is probably a leak in some way, with something not freeing a resource or memory. It is probably therefore easy to find out what is happening, as you can run the code to do everything except actually send, and see what is leaking with FastMM's leak detection. There is also a unit out there that shows a live display of FastMM memory, and you can hack that to log instead, or whatever.

Also, assuming a 32-bit application, I doubt that going more than 4GB would fix anything anyway. Fix the leak and you can size down again.

--

Matthew Jones
Mon, Mar 2 2020 8:34 AMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 3/1/2020 11:41 PM, KimHJ wrote:
> I have a problem every Sunday, the Elevate Webserver crash with a Out of Memory error. What can I do to increase the memory allocated to the Webserver?
>
>  From serveral location is send out hundred of text messages and each message send is received by the webserver and the receiver of the SMS have to answer back which are send to the webserver as well. So with in a 30 minutes period 1000 request are send to the webserver.

Is this web server running any custom modules ?

I'm with Matthew in that initial suspicion is a possible resource leak
so doing a controlled test to better identify a problem and whether it's
simple leak (meaning exe memory usage would continue to go up) or
something with specific volume of requests.

As to increasing memory - EWB web server today is a 32bit exe so it is
limited to 2GB working set so adding more memory to VM would not really
help it.

Raul
Tue, Mar 3 2020 1:28 PMPermanent Link

KimHJ

Comca Systems, Inc

"Matthew Jones" wrote:

>>Okay, so you have it repeatable, which is always good. Two things for starters - you need to find out what the actual problem is. "Out of Memory" can mean you are actually out of memory (object storage), or, on Windows, it can mean you have exhausted the System Handle pool. The latter means you opened too many files, or sometimes GDI objects.

Either way, this is probably a leak in some way, with something not freeing a resource or memory. It is probably therefore easy to find out what is happening, as you can run the code to do everything except actually send, and see what is leaking with FastMM's leak detection. There is also a unit out there that shows a live display of FastMM memory, and you can hack that to log instead, or whatever.

Also, assuming a 32-bit application, I doubt that going more than 4GB would fix anything anyway. Fix the leak and you can size down again.<<

Yes it's a 32bit application, I have a module that receives the incoming SMS and save it to the EDB then I have a 32bit application that check each row added in the database to see if it need to be forwarded by SMS or email.

I look at the weekly usage on the dashboard of the VS and I see the usage goes up and down to low  8.14% to spickes of 38%, but Sunday around 7 pm it goes up to 100% and then down again to around 25% then at midnight it is back to 8.14%. When it hit the 100% the EWB goes down, but the 32 bit application keeps going scanning the database.

I will try FastMM and see if it find any leaks.

Thanks,
Kim

If it was a leak should the memory usage keep going up?
Wed, Mar 4 2020 3:46 AMPermanent Link

Matthew Jones

KimHJ wrote:

> If it was a leak should the memory usage keep going up?

Yes, while it is happening. I've had situations where I do some task, which creates an object, puts it in a list to log later, and then gets on with the next one. At the end, the list is logged and free'd, and the memory drops. But it kept the memory in use while processing others, so it could build up and hit the memory limit. But if it doesn't hit the limit, then there is nothing leaked because it got free'd.

However, I suspect that some object is just not being free'd and FastMM's leak detection will show you that. You will probably have a few "permanent globals" leak too, but they can be ignored as they last the lifetime of the application anyway. There is a FastMM call you can make to tell it to ignore them if you really care.

--

Matthew Jones
Wed, Mar 4 2020 8:36 PMPermanent Link

KimHJ

Comca Systems, Inc

"Matthew Jones" wrote:

>>Yes, while it is happening. I've had situations where I do some task, which creates an object, puts it in a list to log later, and then gets on with the next one. At the end, the list is logged and free'd, and the memory drops. But it kept the memory in use while processing others, so it could build up and hit the memory limit. But if it doesn't hit the limit, then there is nothing leaked because it got free'd.

However, I suspect that some object is just not being free'd and FastMM's leak detection will show you that. You will probably have a few "permanent globals" leak too, but they can be ignored as they last the lifetime of the application anyway. There is a FastMM call you can make to tell it to ignore them if you really care.<<


Thanks Matthew.
Kim
Image