1. Roland Smith
  2. PowerBuilder
  3. Tuesday, 14 February 2023 16:50 PM UTC

I copied an example of using GetProcessMemoryInfo from Chris' STD Framework and I have a question.

I have a PB desktop app that runs as a Windows Service so has no user interaction. I want to track memory use so I can send an alert to someone when there is an issue.

My main question is: Which of the values should I be looking at?

Also, is there another function that would return statistics that are useful for a background PB process?

Benjamin Gaesslein Accepted Answer Pending Moderation
  1. Wednesday, 15 February 2023 10:50 AM UTC
  2. PowerBuilder
  3. # 1

Hi Roland,

I don't use the framework but I do use the GetProcessMemoryInfo api function to monitor a potentially long-running application that is prone to occasional hang-ups. For this purpose, periodically checking changes to the pagefaultcount has proven most useful. No change to the pagefaultcount over a period of time is a sure sign that my application stopped working.

Best regards

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 14 February 2023 18:14 PM UTC
  2. PowerBuilder
  3. # 2

Hi Roland / Miguel;

  You can see the implementation & use in my STD framework for the GetProcessMemoryInfo command - especially in the OrderEntry demo app as a working example.  HTH

Regards ... Chris

Comment
  1. Miguel Leeuwe
  2. Wednesday, 15 February 2023 04:50 AM UTC
Thanks Chris, yes I've seen your memory monitoring in the orderEntry app. Very neat!
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 15 February 2023 16:25 PM UTC
Thanks Miguel!
  1. Helpful
  1. Roland Smith
  2. Thursday, 16 February 2023 14:28 PM UTC
I found that I needed to add a call to GarbageCollect in the main loop. After that the Peak numbers were stable.
  1. Helpful 1
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 14 February 2023 17:26 PM UTC
  2. PowerBuilder
  3. # 3

Hi Roland,

I don't know the answer, but I think you should not look at the available memory in windows, but instead at the available memory on the PB pre assigned memory heap. If I'd only knew how to do that ....

regards.

 

Comment
  1. Miguel Leeuwe
  2. Tuesday, 14 February 2023 17:33 PM UTC
  1. Helpful
  1. Roland Smith
  2. Tuesday, 14 February 2023 18:15 PM UTC
I did some searching and I think the ones I should track are: WorkingSetSize, PeakWorkingSetSize, PagefileUsage, PeakPagefileUsage.
  1. Helpful 1
  1. Miguel Leeuwe
  2. Wednesday, 15 February 2023 04:49 AM UTC
Thank you Roland, I'll try to play around with those.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.