Destroy Grid to Free Memory

In my web app, there are times when I want to destroy a grid to free up memory. I see that there is a destructor() (http://docs.dhtmlx.com/api__dhtmlxgrid_destructor.html) method, but it says it’s for treegrid. I then see the clearAll() (http://docs.dhtmlx.com/api__dhtmlxgrid_clearall.html) method but it says that one deletes all rows and header.

Which one should I use that would aid in freeing up memory?

You may use the destructor() method to clear the memory used by dhtmlxgrid.
This method can be used with the treegrid and grid.