memory problem with tabbar's openning and closing

i made a application similiar like your demo :
when clicking the left tree leaf it will open a tabbar in the right layout.
and unlike your the tabbar content is a very complex custom html page,it consist of dhtmlx’s grid ,toolbar,menu and form (not dhtmlx’s form) and some chlid tabbars ;
the tabbar content is loaded and controlled by my big c# class ;
the problem is when open a tabbar the memory is increased about 12mb!and when closing the tabbar the memory will not only released but also increased to 18mb!!;
so the memory is become bigger and bigger with the tabbar’s openning and closing.
my question is how can i completelly release the memory when the parent tabbar is closed? is there some method to tell my c#class when the event of parent tabbar closing is happened?

thanks for help!

What did you mean by “open a tabbar” and “closing the tabbar” ?

Could you provide a code snippets ?

like your db admin,when click tree it will open a tabbar in the right and the tabbar can be closed.but my opened tabbar contain many things:menu ,toolbar, html form with some tabbar in the bottom



the problem is when the tabbar is close the memory can not be released

Hello,

tabbar doesn’t call destructors of the component that are attached into it. We have fixed this issue. Please try to use the attached file instead of the original. With this library removeTab will call destructors for dhx components that are attached by Container (attachMenu and similar methods)
dhtmlxtabbar.zip (12.3 KB)

sorry same error with new file

There is a tabbar with grid and other other components in the tab of the main tabbar. And these inner tabbar and grid are not initialized by attachTabbar and attachGrid method. So, you need to call destructor() manually.

Tabbar doesn’t have destructor method. However, grid has. Toolbar provides unload() method. You may try to set the “onTabClose” event handler. And call destructor() or unload() for the components that are initialized in this tab.

You need to set onTabClose event handler and call destructor for the grid:

[code]components = {“tab1”:[grid1,toolbar1,…],“tab2”:[…]}

mainTabbar.attachEvent(“onTabClose”,function(id){
if(components[id]){
for(var i=0; i< components[id].length;i++){
if( components[id][i].destructor)
components[id][i].destructor();
else if( components[id][i].unload)
components[id][i].unload();
}
}
return true;
}) [/code]

i tested your demo dbadmin carefully,and i found when i opened a tabbar by click the left tree leaf,the memory increased about 1m,and when i closed the tabbar ,the memory was not decreased at all.

Have you tried to apply the approach that I recommended in the previous answer?

yes,I Have tried to apply the approach that you recommended in the previous answer,and by now when i close the tabbar it did release the memory ,but i want to do furthermore,i want decrease the tabbar’s memory consumption itself,i find that when the tabbar include many dhtmlx componenets like menu,toolbar,grid(see my previous attached picture),the application have large memory consumption,about 200m,so when i open 10 tabbar ,the total memory consumption will be 300m+,so is there some suggestion about how to decrease the memory consumption? i noticed that your dbadmin demo has 50m memory consumption,my grid has more columns than dbadmin.
thanks for help

If the grid is too big, you may try to use SmartRendering or SmartRendering with dynamic loading. In this case the rows won’t render/load at once. Don’t know what else can decrease memory consumption…