Window - Close or Hide?

I’m testing dhtmlx as a basis for a web-app.
Consequently I don’t care about bells, but have to test how components work under heavy load.

Based on your experience what would you suggest to hide/show Window object?

  1. hide/show: w1.hide() / w1.show()
  2. close/create new window: createWindow/ window(“w1”).close()

Each approach has pros and cons.
Pros of #1 - preserve window status; cons: resource (memory) usage.
#2 preserves memory (I think so), but looses window status and takes time to load data.

Question about memory usage concern - does approach #2 really preserves the memory?

Thanks

This depend on how may windows you going keep hidden and “heaviness” of attached content.

If you will show/hide window - it will occupy memory once.
If you will create/close window - time to time garbage collector will free memory.

Note, that window will not clear any kind of external content correctly, for example - it will call unload()/destructor() methods in case of attached grid, tree, layout and other dhtmlx components, but if you’re using your own - it will not cleared by dhtmlxwindows (events, objects, dom points, etc), so you need to clear it manualy.

Please see attached demo (open proclist and check used memory).
42.zip (46 KB)

Thank you for your answer.

Mostly we are planning to open/close urls (w1.attachURL).
Any feedback on Window garbage collection when opening/closing urls?

Depending on url content. You may once attach using attachURL() and second and more time simply change iframe’s src. By the default attachURL clear currently window’s content and create new iframe, etc. Also you may add to attached urls that will clear you custom code.