Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
12
Erster Beitrag:
vor 3 Jahren, 11 Monaten
Letzter Beitrag:
vor 3 Jahren, 11 Monaten
Beteiligte Autoren:
DanM, Fabrice Harari, Peter Holemans, DerekT, steve erts

[WB18]How do you find a memory leak?

Startbeitrag von DanM am 10.01.2014 03:06

I have a website that has a memory leak. 6-10 times per day I must reboot my server due to a memory leak that eats up over 3GB of memory in 1-2 hours each time. The server has 4GB of memory and when first reboot is only using less than 1 GB then within 1-2 hours is maxed out at 3.9GB

We are using Apache for the Web Server & WB18. We are also using classes

I have looked online and there are tools to locate memory leaks for DOT NET but nothing for WD or WB that I have been able to locate.

Any Ideas?

Dan

Antworten:

Hi Dan,

Some questions:
0) In task manager (view processes from all user), which processes are consuming the most memory? Are these WebDev related processes?
1) Classic Mode AWP Mode?
2) HC Classic HFCS or other DB?
3) Session timeout settings on webdev server?
4) Do you clear your queries after having usage/lifecycle in your apps/classes ?(hFreeQuery)
5) ...

Cheers,

Peter H.

von Peter Holemans - am 10.01.2014 09:07
Hi Dan

on top of Peter's excellent questions, are you able to reproduce the problem on a test server? If yes, this gives you a great way to isolate the problem by checking out the memory usage while YOURSELF doing different operations on the web site

Best regards

von Fabrice Harari - am 10.01.2014 12:17
Hi All,

I have a question related to Peter's answer. Is there a substantive difference between "hCancelDeclaration" and "hFreeQuery"?

I have been using "hCancelDeclaration" after I am finished with Queries. Is that sufficient?

Thanks!

von steve erts - am 10.01.2014 15:53
Not sure anyone on here knows

hFreeQuery appeared pretty much unannounced in v16

I now use this in preference on the assumption that PCS must have provided this alternative for some good reason.

von DerekT - am 10.01.2014 16:05
I rebooted server at 11pm then memory was down to 1.03. When I woke up this morning this what I see ...

Services : http://screencast.com/t/tUHp93zJ
Processes : http://screencast.com/t/agtE29KT

After Reboot
Services : http://screencast.com/t/UWtb6qYjz
Processes : http://screencast.com/t/0GQIZq9ZTIo


Pete, Please see below ...

Some questions:
0) In task manager (view processes from all user), which processes are consuming the most memory? Are these WebDev related processes? .... http://screencast.com/t/tUHp93zJ
1) Classic Mode AWP Mode? ...................... AWP Mode
2) HC Classic HFCS or other DB? ................. HFCS (located on the same server as the website
3) Session timeout settings on webdev server? ........Do you mean "Disconnect the idle users since? http://screencast.com/t/ZudBsqnhSn6u
4) Do you clear your queries after having usage/lifecycle in your apps/classes ?(hFreeQuery)

Not sure, I did not build this site, I had it built for me. The site is using SQL statements & classes (no Queries) so I do not know how to determine. Is "clear your queries" only if you use queries or does it apply to SQL statements which are used with classes.

Also ... could the classes or Objects built from the classes be eating up the memory ... if they are not being released?

5) ...

von DanM - am 10.01.2014 16:43
Hi Dan,

Weird, according to your screenprints you have about:
- 60Mb on HyperFileCS memory usage
- 20Mb on WDSession.exe memory usage

So I'm not sure where all the GB's are being used by. At first sight it surely ain't WebDev...

Are you sure you clicked the "View processes from all users" in the task manager?

On the other hand, there's an anomaly in your anwser I think.
If the site is fully AWP, then for each request you should see a WDSession.exe for the time of generating the page and providing it to the browser. Next it should dissapear. So I think it is classic mode and you had 4 sessions in your exemple...

You'll need some more research...
If you have teamviewer I might have a look together with you.
Send me a pm in that case.

Cheers,

Peter H.

von Peter Holemans - am 10.01.2014 17:23
Hi everybody

hcanceldeclaration and hfreequery are EXACTLY the same function. The new name was just added to be more explicit

Best regards

von Fabrice Harari - am 10.01.2014 17:35
Hi Dan

you need to click on the resource monitor button to have more information about the memory usage (even possibly use the systinternal utilities to have even more detailed information)

About the queries, you have to check that after each hexecuteQuery (or equivalent) there is a corresponding hcanceldeclaration

But I agree with Peter, your screenshots do NOT show the whole picture

Best regards

von Fabrice Harari - am 10.01.2014 17:39
Peter, I just sent Teamviewer details to you on Skype

von DanM - am 10.01.2014 18:09
It is displaying all users ... http://screencast.com/t/jd8232REYH7j

And here is the performance : http://screencast.com/t/o0mzpsrYT

Memory is back up to 70% after rebooting just 1 hour ago


Manta.exe after reboot starts at about 21,000K then overtime it never gets lower only rises until I run out of memory ... http://screencast.com/t/gs7Yy83sUOxa

and in less than 1 hour I have over 3.00GB of memory locked up (and never frees up) ... http://screencast.com/t/Yx8ZIKSeY

Here is what is happening on the WebDev Admin ... http://screencast.com/t/RHPEPH8YdSMm

This is the activity on the web ... http://screencast.com/t/VRAesSiLTC7

von DanM - am 10.01.2014 18:38
Hi Dan,

Sorry, just noticing your Skype message now. Sent you a pm...

Cheers,

P.

von Peter Holemans - am 12.01.2014 09:57
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.