trying test ui5 based app. don't opa stuff, i've been using qunit. fine - works should. start scratch every module, tests not pollute each other , can start clean state. however, every time make new instance of app, it's duplicate id errors (obviously...). destroy() gets rid of dom elements related app, active core still alive , that's seems remember created elements, solves nothing.
how can restart ui5? alternative stick every module in own html page, not awesome.
when read post thought: wow, if right, have serious memory leak problem on our hands.
but wrote test... ;-)
http://jsbin.com/pocayekalu/5/edit?js,output
the above test creates garbage controls arrays of random numbers, polluting memory. after 5 seconds destroyed , new ones created - last counter rendered dom.
then ran profiler , watched memory. first grows point, freed regularly again:

what happens is, destroy control, removed map in core, stores reference controls id. that not mean javascript object destroyed - can still hold reference actual object.
as remove references control objects in code, still not mean browser removes them memory, done during next garbage collector run, might started or never - depending on how memory app uses , browser engine thinks sufficient.
it out of control when browser engine decides clean up. in above test browser forced run garbage collection since force run out of memory otherwise.
update:
if have app , controls somewhere under app's control tree (meaning: controls added parent's aggregation), destroying app destroy child controls (and children).
Comments
Post a Comment