I have a big amount of data which is being processing using CLI.
In the scipt the data goes through a foreach cycle.
But on every iteration the memory consumption is getting larger and larger.
Why is this happening? Every var is getting reassigned in the loop, so there must not be memory leaks. Although I tried to set a var null on the end of every iteration, it didn't help.
In the loop I use objects (ActiveRecord) and work with a DB.
At the beginning the script works really fast (about 10 iterations per second), by the end its performance is less than 1 iteration per second.
Thanks.