try to reduce the usage of memory.