Memorymanagement in Web apps? Free needed?

Hi guys,

when I'm doing things like this

vO:=tJsonObject(tJsonobject.ParseJSONValue(Response.ResponseText));    
vO:=tJsonObject(vO.ParseJSONValue(vO.GetJSONValue('value') ));
vtXDataClientLoadProc(Response, vO);

Do we have a problem with created and not freed tJsonObject instances on Webapplication side?

No, in JavaScript, memory management within the browser is largely handled automatically through a process called garbage collection. This process identifies and frees up memory that is no longer in use by the program. JavaScript objects are allocated memory when they are created, and when they are no longer reachable—meaning no references to them exist in the program due to changes in scope, closures, or removed references—they are considered for garbage collection. Modern browsers implement sophisticated algorithms to perform this task efficiently, minimizing the impact on performance and ensuring that memory is available for new objects or for the browser's other tasks.

1 Like

So, I guess the try and finally to free the TJSONObject are never needed and are a holdover from VCL. That means the web core code can be free of free in all cases.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.