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() ( method, but it says it’s for treegrid. I then see the clearAll() ( 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.