pixel
pixel

Reputation: 10537

Apache memory leak

I am using Apache 2.2 on Windows and I can see steady increase in memory for httpd process. I used FastMM memory manager to find memory leaks and while I found some and cleared them and while FastMM is not finding anything anymore, my httpd memory still keeps increasing until it reaches ~2GB cap and crashes.

What are some good strategies / tools to deal with such situations?

This is not a website and there is no PHP involved. We have our custom Apache module (.so) which acts as a server handling SOAP requests that can do inserts, deletes, updates, queries on database. Requests are coming from barcode scanning devices.

Much appreciated,

Upvotes: 3

Views: 9359

Answers (2)

Elvira Gandelman
Elvira Gandelman

Reputation: 376

I found out that setting your "DirectoryIndex" in httpd.conf in the real order (use Notepad++ to count files or just estimate)

Found the information here: HTTPD Apache Docs

I had 25 index.php files and 161 index.html files.

From 25% CPU and 4 Gb memory, Now I'm mostly at 0% CPU and 10-11 Mb memory.

Upvotes: 0

Graphic Equaliser
Graphic Equaliser

Reputation: 197

This is a problem with Apache and also happens with version 2.4 for Windows. Easy fix is to set the MaxRequestsPerChild setting in the http default conf file in extra to a number between 200000 and 1000000, in the Windows section at the bottom of that file, and restart Apache. Memory usage still climbs but it resets itself automatically before the usage climbs high enough to crash the server. HTH.

Upvotes: 2

Related Questions