Jump to content
h4wek

growing memory usage by despawned objects

Recommended Posts

I need to calculate cargo area for specified objects, so I make simple script for get real true info about that, but if you put this to console and wait few minutes (console run continuus this comand in loop and repeating this procedure many times by spawn/despawn all those objects) - the game is stack freezeeng or crash after close console - to repeat effect just put this to function file on empty VR map and you see effect.

 

More simple way to reproduce  is  simple loop command to spawn/despawn for example basic object like

 

while true do { _cargo = "Land_metalBarrel_F" createvehiclelocal [0,0,-1100]; deletevehicle _cargo;}; - command to put in console and leave it for minute for example (teoretically nothing should happen after close console  beacouse engine  spawning and delete still one object right?) so watch the effect and ansver to yourself why it not happen like should be expected.

 

I use this code to take real effect (end unxexpected discover this situation when I leave command in one of console query rows - to read result continously) so:

//----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

//["B_Truck_01_cargo_F","Land_metalBarrel_F"] call boxcount  - command to put in console

 

boxcount = {

params ["_transportertype","_cargotype"]; private _boxcount = 0; private _cargos = []; private _full = false;

if (isClass (configfile >> "CfgVehicles" >> _transportertype >> "VehicleTransport" >> "Carrier")) then {
    _transporter = _transportertype createvehiclelocal [0,0,-1000];
    _cargo = _cargotype createvehiclelocal [0,0,-1100];

    while {!_full} do {
        if ((_transporter canVehicleCargo _cargo)#0) then {
            _transporter setVehicleCargo _cargo;
            _cargo = _cargotype createvehiclelocal [0,0,-1100];
            }else {_full = true};
    };

    _cargos = (getVehicleCargo _transporter);
    _boxcount = count _cargos;

    {deletevehicle _x}foreach _cargos;
    deletevehicle _transporter;
    deletevehicle _cargo;
};

_boxcount

};

 

after that nothing get game back to normal even FLUSH or SUPERFLUSH, only restart of mission clen memory area. Is any solution for that in engine? (this cause after longer perioid of time stack of dedicated server if game running very long on the same mission even optimalised scripts not help beacouse of this effect - it looks like every spawned object make space in memory and not relase it after delete completly - BI guys W..T...F? 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×