Memory Leak in ExtPascal / Linux / Apache / MOD_FASTCGI

15 views
Skip to first unread message

Frank Menne

unread,
Jul 24, 2011, 2:35:49 AM7/24/11
to ExtPascal
Hi !

I have a weird problem with Extpascal:

I Took Lazarus 0.9.30, current Ubuntu Linux, Apache 2.2.16,
MOD_FASTCGI 2.4.6, Current Firefox as frontend.

Compiled the current SVN Trunk with current examples and startet then
without debugger.

On each request which comes from the apache (for example Show source -
Button) memory of the Extpascal backend process increases by 2 MB.

This also happens in current stable Version 0.9.8.

Now I tried that with Lazarus / Windows, there I do not have any
Memory - Problems. No extra memory consumption per request.

Tried to play a little with
FCGIAPP.C, line 626
{$IFNDEF MSWINDOWS}EndThread(0){$ENDIF} // Unix RTL FPC bug

currently with no effect.

Wanderlan Santos dos Anjos

unread,
Jul 24, 2011, 11:15:46 AM7/24/11
to extp...@googlegroups.com
Hi Frank,
 
Tried to play a little with
FCGIAPP.C, line 626
{$IFNDEF MSWINDOWS}EndThread(0){$ENDIF} // Unix RTL FPC bug

currently with no effect.

You removed that line?

See line ~244 too:
change 
  {$IFDEF MSWINDOWS}inherited;{$ENDIF} // Collateral effect of Unix RTL FPC bug
by
  inherited;
 
--
Att,

Wanderlan Santos dos Anjos
(061) (r)3345-5496; (c)9133-3804, (t)3045-4777

Frank Menne

unread,
Jul 25, 2011, 10:35:32 AM7/25/11
to ExtPascal
Fixed half of the memory leak:

At the end of
TFCGIThread.Execute;

if fsession.NewThread=false then
freeonterminate:=true;

instead of the EndThread(0);

After that modification all Helper Threads without own session run
into the Destroy-Procedure after termination. No Access Violation -
that works.

In the ExtPascalSamples I reduced the memory leak from
348 bytes / Request to 188 bytes / Request.

Frank Menne

unread,
Jul 25, 2011, 10:58:09 AM7/25/11
to ExtPascal
Correction: Problem seemt to be gone with the above change. Will try a
24 - hours burn in test.. ;-)

Wanderlan Santos dos Anjos

unread,
Jul 25, 2011, 11:11:45 AM7/25/11
to extp...@googlegroups.com
THANK YOU FRANK!!! :))

I will wait your burn in test...

[]s
Wanderlan

On Mon, Jul 25, 2011 at 11:58 AM, Frank Menne <ffm...@googlemail.com> wrote:
Correction: Problem seemt to be gone with the above change. Will try a
24 - hours burn in test.. ;-)

--
You received this message because you are subscribed to the Google Groups "ExtPascal" group.
To post to this group, send email to extp...@googlegroups.com.
To unsubscribe from this group, send email to extpascal+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/extpascal?hl=en.

Reply all
Reply to author
Forward
0 new messages