on 05-23-2005 7:33 PM
Hi,
when I call the connect method of the company object I get 60MB of memory allocation. I try to call the GC in .net but nothing change.
Someone can help me?
Thanks
60 MB is the standard overhead that comes with the company object. The company object is very heavy and brings a lot of other objects and data with it (not sure why) but unfortunately it is your only way to access everything else.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can look at note 676313:
We recommend .Net developer to call the garbage collector in the Add-On application and not to count only on the .Net framework. The garbage collector tracks and reclaims objects allocated in managed memory. Periodically, the garbage collector performs garbage collection to reclaim memory allocated to objects for which there are no valid references. Garbage collection happens automatically when a request for memory cannot be satisfied using available free memory. Alternatively, an application can force garbage collection using the Collect method. Code:
m_oDriver = Nothing
GC.WaitForPendingFinalizers()
// this will call the garbage collector GC.Collect()
However i think the "SDK connection" need this memory allocation, you can use the GC only to reclaim space for unused onjects.
Hope this helps.
Regards,
Fabio Salucci
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried to destroy the company object and then call the garbage collector but didn't work.
My code:
sbo_company = New SAPbobsCOM.Company
cookie = sbo_company.GetContextCookie
DIconn = SBO_Application.Company.GetConnectionContext(cookie)
sbo_company.SetSboLoginContext(DIconn)
// in this point memory allocation=19MB
errCode = sbo_company.Connect()
//after the connect 65MB
.........
sbo_company = Nothing
GC.WaitForPendingFinalizers()
//memory doesn't change
65MB for one add-on is too expensive, isnt't it?
Hi Federico,
you're right, 65MB is too expensive, but there are no other way (it's the required memory by the SDK, i've got this allocation in all my add-ons).
You have a 60MB allocation when you make the connection (even if you're not using the GC). Using the GC you can reclaim easily the memory after stopping the add-on.
Unfortunately i don't think there's a solution...
Kind Regards,
Fabio Salucci
User | Count |
---|---|
91 | |
10 | |
10 | |
6 | |
5 | |
5 | |
5 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.