Credits go to John Shiells, sysadmin @ Nucleus
If you run a system that handles millions of small files (like a windows-based mail server), you may encounter a problem where RAM seems to “disappear” and services on said server slowly slow down because of swapping. If you look under task manager, you don’t see a smoking gun because all the services running are consuming reasonable amounts of resources. There wasn’t any memory leak with the running services.
In John’s case, his IMAP4 service was running slowly and eventually would hang due to lack of resources. Adding RAM didn’t fix the problem, it just made the system last longer until it ran out of memory.
He discovered it wasn’t a problem with the software he was running but a Windows problem.
Instead of this being a MODUS problem it was actually a windows problem. Every time a file is opened an entry is added to the Windows memory space called Metafile. This memory space just expands and expands until it consumes all the ram on your system, and windows has no internal process to clear it.
Using a program I found called RAMMAP, I discovered that the majority of the ram on the server (about 85% to 90% of it) was being locked up by cashing the Metafile. On most servers we would never see the problem but because there are over a million files on our mail server, the Metafile cache was using as much ram as it could. Because the files on mail are only accessed from time to time (message files), the fix was to cap the amount of physical memory that windows will let the Metafile cache use but there is no ability to do this in the registry.
There’s a fix for it from the Microsoft website.
http://support.microsoft.com/kb/976618/en-us
The fix was originally something you had to pay for but now it’s currently downloadable for free:
http://www.microsoft.com/en-us/download/details.aspx?id=9258
The patch is good for Windows 2003 and Windows 2008 R2 including 64 bit.
Leave a Comment