1. Roland Smith
  2. PowerBuilder
  3. Wednesday, 28 February 2024 02:00 AM UTC

I have an application that uses a large amount of memory. Using GarbageCollect doesn't release memory back to the operating system that I can tell.

Is there an undocumented function to tell PowerBuilder's internal memory manager that it should release unused memory?

I tried using SetProcessWorkingSetSize but that doesn't seem to help either. SetProcessWorkingSetSize works great in one of my C++ apps that calls PB via PBNI.

 

Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 28 February 2024 03:09 AM UTC
  2. PowerBuilder
  3. # 1

PB 2022-R3

There is one auto-instantiated object with 'common' functions defined as an instance variable within objects that are manually created/destroyed.

It only uses DataStores.

I have the following pb.ini:

[Application]
Accessibility=0
Citrix=1

[DataStore Behavior]
UseHwnd=No

[Data Window]
Accessibility=0

 

I should note that this is a multi-threaded non-visual application that receives processing requests via Winsock. I wrote the basic framework and one of my customers added business logic. They are using the new DotNetAssembly feature to call C# functions.

Comment
  1. mike S
  2. Wednesday, 28 February 2024 03:30 AM UTC
is the issue the datastores? if so, you may want to try your own recycler for the datastores. rather than destroy them, recycle them. you would need an array to track them, and then a function to get the last one recycled (and create one if no recycles are available). I did this for a particular type of datastore i was using to pass data.

  1. Helpful
  1. Roland Smith
  2. Wednesday, 28 February 2024 03:51 AM UTC
The Multi-threaded object is re-used. I'm using CreateEvent, WaitForSingleObject, SetEvent to keep track of which ones are busy and which ones are idle.

The business logic object is created fresh for each request so that wouldn't help, unless I created an array of instance variables in the multi-threaded object and passed them to the business logic object.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 28 February 2024 02:19 AM UTC
  2. PowerBuilder
  3. # 2

Hi Roland;

  Can you tell us ...

  • What version & build of PB are you using?
  • Does your App use "Auto Instantiated" objects?
  • Does your App use DataStores?
  • Have you tried any custom PB ini settings?

Regards ... Chris 

Comment
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.