logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: Memory problem with shared object module ?
Author
_db_



Joined: 16 Apr 2014
Posts: 8
Location: Canada

PostPosted: Wed 16 Apr '14 19:55    Post subject: Memory problem with shared object module ? Reply with quote

Hi Experts,

I am new to Apache, please help.

I have written an Apache shared object module (written in Delphi 2010) that acts as a server for my client(s) (written in C# for .NET CF, Windows Mobile 5.0). Clients make SOAP request to my apache module, module talks to database and returns SOAP responses to client(s).

Task Manager shows httpd processes (incoming requests from clients) each using about 35000K but every once in a while, one of httpd processes will grow in memory/CPU usage and over time reach the cap of 2GB, and then it will crash. Server reports "Internal Server 500" error in this case.


I use FastMM to check for memory leaks and it does produce log but there is no memory leaks reported. To make sure I use FastMM properly, I introduced memory leaks and FastMM will log them. So, my assumption is that I do not have memory leak but that somehow memory gets consumed until 2GB threshold is reached and not released until I manually restart Apache.

Once I manually restart Apache, my devices can again connect.

How to handle this issue?
Is there a leak and how to find it or there is something else I could do and what?

Any help is highly appreciated.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sun 20 Apr '14 19:24    Post subject: Reply with quote

Turn your log level to debug and see if you can find anything in the apache error log.
Back to top
_db_



Joined: 16 Apr 2014
Posts: 8
Location: Canada

PostPosted: Sun 20 Apr '14 20:49    Post subject: Reply with quote

Hi James. I get 500 'server error' in error log.
Thanks

UPDATE:
Access log shows 500 which I believe means Server Error 500.

access.log:
10.0.2.12 - - [22/Apr/2014:07:39:22 -0400] "POST /TMDocking/Soap/IMyDock HTTP/1.1" 500 361

And the error.log below shows entries for process 4692 which is the httpd process (one of few I can see in Task Manager) that reaches memory cap of 2GB leading to user having to manually restart Apache.

error.log:
//here are log entries to process 4692 which is the process that was reaching memory gap of 2GB. Once it hapens, user has to restart apache.
[Tue Apr 22 07:51:22 2014] [notice] Parent: Created child process 4692
[Tue Apr 22 07:51:22 2014] [debug] mpm_winnt.c(487): Parent: Sent the scoreboard to the child
[Tue Apr 22 07:51:23 2014] [notice] Child 4692: Child process is running
[Tue Apr 22 07:51:23 2014] [debug] mpm_winnt.c(408): Child 4692: Retrieved our scoreboard from the parent.
[Tue Apr 22 07:51:23 2014] [info] Parent: Duplicating socket 460 and sending it to child process 4692
[Tue Apr 22 07:51:23 2014] [debug] mpm_winnt.c(605): Parent: Sent 1 listeners to child 4692
[Tue Apr 22 07:51:23 2014] [debug] mpm_winnt.c(564): Child 4692: retrieved 1 listeners from parent
[Tue Apr 22 07:51:23 2014] [notice] Child 4692: Acquired the start mutex.
[Tue Apr 22 07:51:23 2014] [notice] Child 4692: Starting 150 worker threads.
[Tue Apr 22 07:51:23 2014] [notice] Child 4692: Starting thread to listen on port 81.
[Tue Apr 22 12:30:06 2014] [info] [client 192.168.6.183] (OS 10054)An existing connection was forcibly closed by the remote host. : core_output_filter: writing data to the network
[Tue Apr 22 12:35:05 2014] [info] [client 192.168.6.183] (OS 10054)An existing connection was forcibly closed by the remote host. : core_output_filter: writing data to the network
[Tue Apr 22 12:46:04 2014] [info] [client 192.168.6.183] (OS 10054)An existing connection was forcibly closed by the remote host. : core_output_filter: writing data to the network
[Tue Apr 22 13:00:34 2014] [info] [client 192.168.6.183] (OS 10054)An existing connection was forcibly closed by the remote host. : core_output_filter: writing data to the network
[Tue Apr 22 13:04:21 2014] [info] [client 192.168.6.183] (OS 10054)An existing connection was forcibly closed by the remote host. : core_output_filter: writing data to the network
[Tue Apr 22 16:02:42 2014] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Tue Apr 22 16:02:42 2014] [notice] Child 4692: Exit event signaled. Child process is ending.
[Tue Apr 22 16:02:43 2014] [warn] (OS 10038)An operation was attempted on something that is not a socket. : setsockopt(SO_UPDATE_ACCEPT_CONTEXT) failed.
[Tue Apr 22 16:02:43 2014] [info] Child 4692: Accept thread exiting.
[Tue Apr 22 16:02:43 2014] [notice] Child 4692: Released the start mutex
[Tue Apr 22 16:02:43 2014] [info] Child 4692: 147 threads blocked on the completion port
Back to top


Reply to topic   Topic: Memory problem with shared object module ? View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules