Out Of Memory errors

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
Grautvornix
New user
New user
Posts: 11
Joined: 2016-01-22 10:45

Out Of Memory errors

Post by Grautvornix » 2020-04-21 10:44

Hi all,

we're running version 5.6.7-B2425 with MySQL 8.0.19 on a windows 2012R server. The Server is virtualized (VMware 6.7) and has 8 GB RAM and 4 CPU cores. The hmail data directory is excluded in the virus scanner. We have 8000 mailboxes with a max size of 200MB.

Some weeks ago we had a large increase in the amount of sent and received emails due to corona. Then the HMS ran out of memory serveral times a day, followed by some error messages

"APPLICATION" 2824 "2020-04-02 01:08:30.406" "OutOfMemoryHandler - hMailServer has run out of memory, clearing caches."
"APPLICATION" 2824 "2020-04-02 01:08:30.453" "OutOfMemoryHandler - hMailServer has run out of memory, clearing caches."
"APPLICATION" 2824 "2020-04-02 01:08:30.453" "OutOfMemoryHandler - hMailServer has run out of memory, clearing caches."
"ERROR" 2824 "2020-04-02 01:08:30.453" "Severity: 2 (High), Code: HM4208, Source: File::ReadFile(), Description: An error occured when reading file., Message: bad allocation"
"ERROR" 2824 "2020-04-02 01:08:30.453" "Severity: 3 (Medium), Code: HM4227, Source: File::ReadFile, Description: An unknown error occurred while reading file from disk."
"ERROR" 2824 "2020-04-02 01:08:30.453" "Severity: 3 (Medium), Code: HM5042, Source: File::ReadTextFile, Description: An unknown error occurred while reading a text file from disk."
"ERROR" 2824 "2020-04-02 01:08:30.453" "Severity: 1 (Critical), Code: HM5062, Source: IMAPFetch::ReportCriticalError_, Description: ERROR HM10001 - IMAP FETCH: Error when loading MIME message. - D:\MAIL\Data\....eml"

There were also a lot of minidumps at that time.

We started to reboot the server every morning, but at night the errors occurred again. We reboot twice a day now and errors and minidumps doesn't happen anymore, except error 4403:

"ERROR" 1328 "2020-04-19 12:46:00.323" "Severity: 3 (Medium), Code: HM4403, Source: Message::GetHeader, Description: Could not read the message header, since the file was not available. File: D:\MAIL\Data\....eml"

I read in this forum that adjusting the max. number of command threads can help, but it depends on a lot of parameters like CPU cores or threads, RAM, internet speed and other. There are no precise recommendations, so one can only try and see if it works. Is this correct?

In the past we had errors "Code: HM4208, Source: ExceptionHandler::Run, Description: An error occured while executing 'IOCPQueueWorkerTask'", so I increased the max. number of command threads from 15 to 30 first and then when HM4208 came back I set the value to 40. Both times it helped, although the value was too high already according to the posts in the forum.

Is there another way to prevent Out Of Memory errors than rebooting the server twice a day? Trial and error method is not an option.

We accumulated a lot of entries in the IP Ranges list, it's nearly 200 now. Can this be a problem for memory consumption?

Thanks,

Btw: we sent you two requests through https://www.hmailserver.com/services, one for incident support three weeks ago and one for managed services last week, but we didn't get any response...

User avatar
Dravion
Senior user
Senior user
Posts: 1688
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Out Of Memory errors

Post by Dravion » 2020-04-21 10:50

Install a 64-Bit build of hMailServer to avoid out of Memory Situations.

Grautvornix
New user
New user
Posts: 11
Joined: 2016-01-22 10:45

Re: Out Of Memory errors

Post by Grautvornix » 2020-04-21 14:35

Is there a x64 production version?
5.7.0-B2496 on https://github.com/Dravion/hMailServer/releases ?

And do you have any suggestions for our current problem?

User avatar
Dravion
Senior user
Senior user
Posts: 1688
Joined: 2015-09-26 11:50
Location: Germany
Contact:

Re: Out Of Memory errors

Post by Dravion » 2020-04-21 15:11

The Problem is what it says:

Out of Memory, which means the Address space (which can max 2 GBytes of Memory) is to small for your Setup.

There is no final x64 Version, but you can use my custom build which has at least a OpenSSL 1.1.x version included.
https://www.hmailserver.com/forum/viewt ... 10&t=34621

User avatar
SorenR
Senior user
Senior user
Posts: 3829
Joined: 2006-08-21 15:38
Location: Denmark

Re: Out Of Memory errors

Post by SorenR » 2020-04-21 16:22

SørenR.

“Those who don't know history are doomed to repeat it.”
― Edmund Burke

Post Reply