on 07-03-2017 2:43 PM
Hello,
I've realised that every addon I've made is consuming a lot of memory. B1 client starts using about 300mb and suddenly it increases by 250mb when I start using my addons (550mb total). By commenting and uncommenting lines I found out that the line which is causing this is the following:
SAPbobsCOM.Company oCompany = (SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany();
I added the following code at the end but nothing happened
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(rs); //recordset
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(oCompany); //company object
rs = null;
oCompany = null;
GC.Collect();
I'm only worried about the memory. Performance is ok because my addons are quite simple.
Hi Rudá,
Unfortunately this is common. If I'm not wrong there is no way to avoid this, this happen only with the first addon connection.
This code:
SAPbobsCOM.Company oCompany = (SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany();
it is the better way to access the DI company object and avoid more memory increase, but if your add-on be the first add-on to initialize on the SBO your add-on will increase the memory. The next add-ons that use the same line of code, doesn't increase 250mb memory in your SBO, because they will reference an existing company object.
Maybe someone else have a better explanation.
Hope it helps.
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.