Highlighted
Absent Member.
Absent Member.
513 views

[archive] Need a favour - related to threads

[Migrated content. Thread originally posted on 20 September 2007]

Hi,

Looking for a little help.
I believe I have a memory leak issue when running via thin client.
I'd really appreciate if you could try this on your own system and see what happens.

Here's the problem.
The zip file will contain program1, program2, config.txt and a shortcut to run program1.
You'll need to amend the CODE-PREFIX in the config file to suit.

Firstly, I'm running V7.2.0 under XP with SP2
So, when I run this using local runtimes I do the following.
I do a control break and then press the push button.
I then view memory usage in the debugger.
It tells me Total = 411748
I then just go, the sub program is displayed and I just press escape to quit back to the main thread.

I do another control break and then press the push button again.
I then view memory usage in the debugger.
It still tells me Total = 411748

All good.

If I set the thing up to run via thin client mode on our SCO Openserver 6 machine still using V7.2.0 and do the very same procedure, but obviously using acuthin locally (Again V7.2) I seem to have a memory leak.

My total before pressing the push button is 292502.
After quitting program2 and returning to the main program, the memory total on the second press of the button is now 293686.

This seems to me to be quite a large leak of 1184 bytes.

I had reported this to the UK support centre, but really have to start again because of the microfocus acquisition.
It was previously logged as ID 99-046187

I'm going to raise this again with support, but would appreciate your views/thoughts when you're able to spare a moment.

Many thanks,

Shaun
0 Likes
6 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Need a favour - related to threads

It seems to me that you never destroy the menu you create in program2. As menues are considered global, this means they do not automatically get destroyed by exiting the program.
As such, I would consider it expected, what you see.
On the contrary, you claim there are no memory leak when you run it locally. This is a bit odd.
If you destroy the menu before returning from Program2, do you still have the leak?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Need a favour - related to threads

Thanks for the reply Gisle.

Unless i'm missing something here I do destroy the menu. This is what started us off down this route in the first plase, it was after you said to me that MAV's were usually because of things not getting destroyed.
We then discovered that even though acubench writes the code to create/display things, it doesn't tidy up afterwards.


       Acu-Main-Logic.
      *{Bench}entry-befprg
      *    Before-Program
      *{Bench}end
           PERFORM Acu-Initial-Routine
      * run main screen
      *{Bench}run-mainscr
           PERFORM Acu-Screen1-Routine
      *{Bench}end
      *     PERFORM Acu-Exit-Rtn
           CALL "W$MENU" USING WMENU-DESTROY, Screen1-Mn-1-Handle
           EXIT PROGRAM
           STOP RUN
           .
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Need a favour - related to threads

Sorry, I could not see that code in Program2.cbl.

If you reduce the number of items in the menu to a minimum, does it affect the leak?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Need a favour - related to threads

Yes and No Gisle.
I removed the menu completly - leak now 1168
Then i removed the list box, the menu, the status bar.
There were removed 1 by 1 and checked the leak each time which is reducing.
Leak down to 380 after all above removed.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Need a favour - related to threads

Since it is reducing by the components, I am pretty sure this has to do with mirrored handles then. I understand that this leak does not occur in 8.0. I figure the best thing to do is to upgrade to that one then.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Need a favour - related to threads

Thank you Gisle.

V8.0 already ordered for testing, then we'll upgrade the end users if all goes well.

Shaun
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.