1. Mary Jane Foster
  2. PowerBuilder
  3. Monday, 18 July 2022 16:56 PM UTC

Hello:

Back in March we migrated from PB 2017 to PB 2021 (we are now on MR 1509).  Since March some of our users are experiencing a situation where the picture buttons no long display words or images, and fonts become larger and are bold, and the main image never displays.  We have been using this application for years and this is new.  The first screenshot shows you what is happening.  The second screenshot shows you what it should look like when it's running smoothly.  We have looked for any places where we have missed garbage collection, deleting objects, etc., and it continues to happen  - sporadically.  We have yet to be able to duplicate it. 

Have you seen this behavior before?  Is this some type of memory issue and, if so, where do I look to monitor that information?   Any insight would be appreciated!

 

 

 

Thank you.

MJ

Mary Jane Foster Accepted Answer Pending Moderation
  1. Wednesday, 20 July 2022 17:37 PM UTC
  2. PowerBuilder
  3. # 1

Hi all:

First, thank you for all the suggestions.  We have tried everything and it looks like we've narrowed it down to a memory leak in a third party tool we use to display our images.  We've submitted a ticket their company but given past experiences we are not hopeful. 

Since everyone is so helpful here, I thought I'd ask another question of those who have experience with any 3rd party tools, or even with PB tools that display images.  Before answering though, here is additional information:

  • Our images are stored on the network and we have 2.5 million of them of varying sizes and clarity based on where they are being displayed, i.e., web vs our PB applications
  • We display large and thumbnail images.  And we can have thousands of images retrieved for display 
  • One thing I left out before is we are compiling as 64bit exe.

We're currently playing with PB's web control to see how that helps us, but so far the retrieval speed is significantly slower.  Any tips/tricks there would be great.  Any suggestions on 3rd party tools would be great too.

Happy Wednesday all!

 

MJ

Comment
  1. Mary Jane Foster
  2. Thursday, 21 July 2022 16:11 PM UTC
Hi Roland:



Your app uses the picture object and we tried building our image gallery using the native picture object but it was way too slow. It seems it can't handle loading all all the images into memory. So we tried web control and found it faster, but still not as fast as the 3rd party tool we have been using.



I appreciate your taking the time to send though. I am grateful for all the help I continue to receive from folks.

MJ
  1. Helpful
  1. Ronnie Po
  2. Thursday, 21 July 2022 16:22 PM UTC
Hi Mary Jane,



i don’t have any hard numbers on this, but I’ve found that a picture object in a DataWindow was significantly faster at displaying images than a picture control in a Window.
  1. Helpful 1
  1. Chris Pollach @Appeon
  2. Thursday, 21 July 2022 17:05 PM UTC
Adding to Ronnie's suggestion ... You can also try the InkEdit control or InkEdit DataWindow. ;-)
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 19 July 2022 18:05 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Mary Jane - 

I'm attaching a tiny sample app that shows how to invoke the GetGuiResources Windows API function. It's been tested both 32-bit and 64-bit.

I hope it helps.

Best regards, John

Attachments (1)
Comment
There are no comments made yet.
Mary Jane Foster Accepted Answer Pending Moderation
  1. Tuesday, 19 July 2022 16:06 PM UTC
  2. PowerBuilder
  3. # 3

Chris, 

Our Network/Security Manager is asking if we need to download all of the classes you have, or just those for the Order Entry?  

And if you could point me in the right direction for the GDI stuff, that would be great!

MJ

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 19 July 2022 20:29 PM UTC
Hi MJ;

The OrderEntry Demo App is built from the framework & uses 90% of it's features. So basically, you can see the framework "in action" as a normal PB App would use it.

I also have the "barebones" framework that would be used if you are going to build a PB app from scratch. Either way, the base libraries contain the same code.

The GDI resources are basically how the O/S tracks every visual object. Internally, they are tracked by RCBs (resource control blocks). Basically one RCE for each object's resources being held by the App or by the O/S on behalf of the App. These are what we call GDI resources and they are quite expensive by the OS to allocate / deallocate / manage (scan).

One way to help lower GDI' resources used is to try using the GarbageCollect() commands to force freeing memory when you detect a high usage.

The other approach is preventative by replacing common OS controls like CB, LB, RB, SLE, etc with one external DataWindow (for example). The DW object only uses a minute amount of resources vs all these native controls on a window surface (for example).

HTH

Regards... Chris

  1. Helpful
There are no comments made yet.
Mary Jane Foster Accepted Answer Pending Moderation
  1. Tuesday, 19 July 2022 14:18 PM UTC
  2. PowerBuilder
  3. # 4

Hello to all:

We were able to reproduce it the moment we hit the 10,000 GDI limit.  The interesting thing is we closed everything except the frame and it still has 9,312 GDI objects in memory.  We've been through the code and believe we have reset, destroyed, etc. all objects with regard to our images.  You would think by closing all the windows but the frame the number of GDI Objects would have decreased dramatically.  The frame itself is 198 GDI (at least it is when I first open the application).

Any suggestions on the quickest way to see what objects still exist?  Or is it a PBTrace?    Thanks.  cool