Hello everybody!

I'm getting into trouble with data import, because of huge sugar's memory consommation.

I'm using Sugar 5.2.0 pro, and my php.ini is configure to accept large needs of time/memory:
max_execution_time=360000
memory_limit=512M.

I need to realize daily imports of thousands of data. This isn't a problem if we use the interface of Import module since it splits the file into smaller ones, and deals with it with asynchronous requests.

But we have to do it every day with a scheduled task, so without any interface. I used quite the same code as in Import module, but I had a bad surprise when I saw that memory usage always increase, until it crashes.

So I used the function memory usage and found out that this leak of memory comes from every retrieve call on a SugarBean...

At this time, I'm out of ideas... Maybe there is a way to deallocate memory during the script?
Or is there a way to call successively external scripts for each small file so a new memory stack would be used?

All ideas or suggestions are welcome!!

Thanks by advance.
Michel