1. Tomáš Podzimek
  2. PowerBuilder
  3. Tuesday, 7 March 2023 13:57 PM UTC

Hi,
I'm back with the problem of the app crashing. We are currently using PB22 1892, 32bit version.
We are still dealing with random app crashes and there seems to be some connection with GDI objects.
What happens is that if the application crashes due to running out of GDI objects limit, after a new start the application starts crashing earlier, as if there is some allocated memory left somewhere from the previous crash. Restarting the computer will help.
Is there any way to restore the state of the computer without rebooting?
From what I've read, GDI objects belong to a single process, so it's not clear to me how a crashed app can affect a new restarted one.
The tester was able to reproduce it by running the app in multiple instances. The later instances started to crash earlier, they even didn't reach the GDI objects limit.
Any idea what we could do?

Regards,
Tomáš

Olan Knight Accepted Answer Pending Moderation
  1. Thursday, 9 March 2023 00:37 AM UTC
  2. PowerBuilder
  3. # 1

This might seem silly, but have you examined the code to ensure that CLEANUP is occurring in the app? This means when you create a DS you delete the DS when you are done with it, and you delete any objects you create when their use is finished. You also perform GarbageCollection on an EXE in the CLOSE event.

That kind of thing.

Comment
  1. Tomáš Podzimek
  2. Thursday, 9 March 2023 13:46 PM UTC
Yes, I've checked most of the main objects for a proper cleanup. It doesn't seem to be the case. When closing a form, a GDI value decreases. The problem is when user opens a lot of forms.

Manually calling a Garbage collector lead to an even more unexpected behavior of the app. Tested on another occassion.
  1. Helpful
  1. Olan Knight
  2. Thursday, 9 March 2023 23:20 PM UTC
That is bizarre!

According to your original post, when multiple instances of the app are opened, the LATER instances abend first. This sure looks like there is but a single source for that GDI counter; meaning I wonder if each instance of the app is seen as a separate instance by Windows.

1. Add the SESSION column to Sysinternals Process Explorer .and look at the values when running one instance. Try to see what action in the app causes the GDI to increase.

2. I also wonder if the app is making multiple connections to the database.

3. Are there web-based activities generated from the app?
  1. Helpful
  1. Tomáš Podzimek
  2. Sunday, 19 March 2023 18:08 PM UTC
Sorry for a late reply.

I am not sure how Windows handle multiple instances of the same app. I would say they should be independent of each other.

I will try to play a bit with Sysinternals Process Explorer.

One app is making one connection to the DB.

Basically there are no web-based activities during regular work with the app.



Meanwhile our tester found another way to make an app to crash in a different way which also doesn't make sense. I'll have to open a ticket with this issue...
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 7 March 2023 20:44 PM UTC
  2. PowerBuilder
  3. # 2

Hi Tomáš;

   Instead, have you tried preventing the GDI issue from occurring in the 1st place? For example ...

https://stackoverflow.com/questions/9723470/whats-the-upper-limit-on-gdi-objects-for-one-process-in-windows-7?noredirect=1&lq=1

HTH

Regards ... Chris

Comment
  1. Tomáš Podzimek
  2. Thursday, 9 March 2023 13:47 PM UTC
Thanks, we will look at it...
  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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.