cancel
Showing results for 
Search instead for 
Did you mean: 

Stopping My Add-on and Add-on Memory

Former Member
0 Kudos

Hello,

What is the proper code to put in the aet.ShutDown event to properly terminate the add-on?

I tried to put End, but the add-on was still running in the processes after SAP was closed.

another question: why is my add-on taking 63k of memory??

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

One more thing, when I stop the add-on from the add-on manager, it is still running in the processes! Is this the same issue?

former_member201110
Active Contributor
0 Kudos

Hi Ralph,

The only thing I can see wrong with your code is that you are calling GC.Collect after exiting the application (ie GC.Collect won't run as the application has already quit).

If you stop the add-on from the Add-on Manager then the event that is fired is aet_ServerTerminition and not aet_ShutDown. Note, there is a 'bug' in SBO that will report that the add-on failed to stop, even though it has unloaded from memory. See SAP note 820898 for more details.

Hope this helps,

Owen

Former Member
0 Kudos

For the memory issue, yes it is 64MB. I'm glad to know that it is normal.

However, for stopping my Add-on, disconnecting the company didn't work. Any other suggestions?

thank you

P.S: This is the code that I have used so far:

If EventType = SAPbouiCOM.BoAppEventTypes.aet_ShutDown Then

oCompany.Disconnect()

System.Windows.Forms.Application.Exit()

GC.Collect()

End If

Former Member
0 Kudos

<i>why is my add-on taking 63k of memory??</i>

If you mean 64<b>Mb</b> then it is probably because you use the DI API. It has always been a huge memory hog and unfortunately you can't really avoid it in most add-ons. I think SAP recommends something like a minimum of 128Mb memory required per add-on.

Try calling the Disconnect method of the DI API Company object before ending the add-on to see if that helps with your shutdown problem. Also make sure you are only connecting to the DI once through single sign-on.

John.

Former Member
0 Kudos

I use this code with VB6. I had some problems with 2004 but in 2005 works fine

Case aet_ShutDown:
            oCompany.Disconnect
        Close
            Sleep (2000)
            End

About memory, if you are talking about 63MB that is normal. Addons need lots of memory. In fact we are experiencing lots of perfomance problems since we upgraded to 2005