Clicky

Can anyone give me help in the use of Perfmon. I have run it and used it in the past to prove that a system has a memory leak whereby after a period of time the system performance will start to degrade and a restart  of the PC is required.

What I cannot remember is which 'counters' were added to enable us to get some idea of the rate of the leak.

Please give specific advice and only in relation to Perfmon as we do not have the budget to go out and buy other 'Leak detection' tools

Thank You

asked 11/17/2011 12:51

aphuk's gravatar image

aphuk ♦♦


12 Answers:
If you know the process that has the leak look at the change in memory use by the process.
http://www.myitforum.com/articles/1/view.asp?id=1439

Setup snmp/wmi scripts that poll the memory usage of applications.
http://help.lockergnome.com/windows2/identify-runaway-process-memory-leak--ftopict488782.html

Presumably you already have a suspected culprit in mind, i.e. if it is a web based, IIS and the web base app is the issue.
link

answered

arnold's gravatar image

arnold

Thanks Arnold.

Useful info on the first URL and has helped me determine next step. The second URL you posted takes me to the same info as the first and I found no snmp/wmi? script help there?

Yes, you are right. There is a suspected culprit. It is an OPC server application from a 3rd party. Still not sure which 'Counters' I should add in relation to Perfmon?
link

answered 2011-11-18 at 09:18:32

aphuk's gravatar image

aphuk

Does the 3rd party application have its own counters?
The only other thing you could do would be to use WMI
http://stackoverflow.com/questions/701904/get-current-memory-utilisation-of-a-process-running-on-a-remote-machine-with-wmi
You would need to store the results and perform the change of use as part of your script.
http://msdn.microsoft.com/en-us/library/ms974615.aspx

link

answered 2011-11-20 at 16:06:45

arnold's gravatar image

arnold

About the third party application and it's counters .... I do not know and would not know where to begin to answer that one sorry :(

Have no knowledge of scripts as I am not a programmer and all work/monitoring on this particular PC would have to be done locally (on the PC itself) as it does not support remote connections.

Looks like I am done for. I was hoping that it would be a simple matter of trending the depletion of the PC from various counters (TBD) and showing how long it  takes before the PC becomes unstable due to memory depletion caused by an application that is failing to release memory

link

answered 2011-11-20 at 17:10:21

aphuk's gravatar image

aphuk

You could setup a counter/alert when total memory usage exceeds a specific threshold.
Monitor paging file as well as that would often reflect the issue. i.e. the OPC has grown so large as to drain the system when paging is needed.

Double check the configuration of the server performance (properties of my computer\advanced\performance settings\advanced to make sure if this is an application that the system processor and memory are prioritized for applicatioin) this may help in reducing the paging.  The other issue is if this application is network based, to alter the network prioritization (properties of the network connection, properties of the file and printer sharing, and set the maximize throughput for network application instead of file sharing.)

Unfamiliar with OPC.
Did this issue arose following a recent change or did it build based on additional data build-up?
link

answered 2011-11-20 at 18:53:30

arnold's gravatar image

arnold

Sorry for the delayed reply Arnold but i have been offshore trying to monitor this problem. Thanks for the feedback.
OPC stands for OLE for Process  Control and is a replacement for NetDDE (FastDDE). It is used by industrialised control systems.
The OPC Database holds data gathered from process devices for use by GUI's, Historians and Enterprise systems typically.
The issue has always been present and, over time, it eventually halts the PC. I have seen this before and it was related to OPC application code not releasing memory after it had run. Therefore, dependent upon how often the 'buggy' code is called will determine at what rate memory is depleted. Initially what i have to prove is that memory is being consumed rather than try and identify the culprit. If i can produce Perfmon logs/screens that show the decline in memory then i can get support for a deeper investigation
link

answered 2011-11-20 at 22:09:28

aphuk's gravatar image

aphuk

Monitoring memory Available (bytes/kbytes/mbytes) depending on granular you want the report.

The sample interval and the duration you can insert this data into a permon database table. You can then use the sql to generate a report to give you the memory change delta.
etc.
If all things are the same other than the OPC process running, the change in memory usage over time can be attributed directly/solely to the OPC application
You may want to add additional data points outside of memory i.e. page file, cache, etc. since those will start manifesting a larger impact on the system as the available memory is depleted and other applications are swapped in and out.
link

answered 2011-11-21 at 21:09:38

arnold's gravatar image

arnold

Thanks Arnold.

So it is possible to get Perfmon to take log how much memory has been used and to log the memory available? I assume this goes to a straightforward text file that can then be imported into EXCEL or the like?

As far as the OPC application goes...once the PC has been started the OPC application is the ONLY thing that is running dynamically.
link

answered 2011-11-21 at 23:18:52

aphuk's gravatar image

aphuk

Yes, You can use counter logs with the data saved into a CSV file.
And configure it to start/stop when you want.

What is the average time from when the system is rebooted to the time when it needs to be rebooted again?

Is the application running as a service which can be restarted?
link

answered 2011-11-22 at 18:46:40

arnold's gravatar image

arnold

Apologies for the long delay and thanks again for your input. Have just returned onshore and before I left I setup the counter logs and someone will get them to me on a daily basis.

You asked what the average time was before a reboot was required and that is impossible to answer as the consumption of memory is non linear but rather based on how active the control system is as far as OPC tag updates are concerned.

The application is a 'service' which autostarts  
link

answered 2011-11-23 at 05:16:40

aphuk's gravatar image

aphuk

You can use alert/sheduled task to manage the memory consumption by the system by reseting the service before the system gets to the non-responsive state.

I.e. the alert function would be to run a script that does the stop/start of the service.
Or have the script run as a scheduled task off hours.  You could use a WMI to check counters and act.
http://itknowledgeexchange.techtarget.com/vbscript-systems-administrator/using-vbscript-to-gather-server-performance-counter-data-with-wmi/
link

answered 2011-12-11 at 22:41:33

arnold's gravatar image

arnold

Until such time as we can get the vendor to correct the bugs in his application then we can use this solution to control and track the problem
link

answered 2011-12-12 at 06:35:08

aphuk's gravatar image

aphuk

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

Asked: 11/17/2011 12:51

Seen: 224 times

Last updated: 12/12/2011 07:40