High Memory Usage - CakePHP ORM functions

Hi All,

I am facing issue when update/insert records in loop to multiple table, at each iteration memory usage increase, please check logs below, currently it is set to 2GB in .ini file…

2016-11-15 11:57:03 Error: 0—8531432
2016-11-15 11:57:03 Error: 1—8583864
2016-11-15 11:57:03 Error: 2—8634592
2016-11-15 11:57:03 Error: 3—8685320
2016-11-15 11:57:03 Error: 4—8736048
2016-11-15 11:57:03 Error: 5—8786776
2016-11-15 11:57:03 Error: 6—8837504
2016-11-15 11:57:03 Error: 7—8888232
2016-11-15 11:57:03 Error: 8—8938960
2016-11-15 11:57:03 Error: 9—8989688
2016-11-15 11:57:03 Error: 10—9040416
2016-11-15 11:57:04 Error: Fatal Error (1): Allowed memory size of 10485760 bytes exhausted (tried to allocate 49 bytes)

I use the querybuilder and regular pdo, not orm, You won’t believe me, but you’d be so much better just writing regular queries and not messing with an orm, except for simple stuff, regular queries are transportable, specialized orm stuff is not.