fix overuse of memory

EDX-341 fix overuse of memory