How to reduce memory usage ? #165
Replies: 3 comments
-
Being as the library mostly provides objects for holding the data returned from NetSuite its safe to say either you're running an already large application where the results are just pushing you over the edge or the results themselves where really large. Without knowing exactly what you're doing, the best suggestion I can give is if you're using something like a search where you can limit the fields returned, try to optimize your application to request the fewest fields possible. This can also help improve the performance on netsuite's side so its a win/win. For example, I have a process that will search for problematic values on records. Because I don't know if it will return 1 or 10k results, I just get the ids and some key fields back and then push them onto a queue where a separate background process will pull each result to review and fix it individually. This can result in more overall requests but each individual request are much more efficient and the overall resource load is significantly lower. Hope that's helpful. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply. |
Beta Was this translation helpful? Give feedback.
-
I did write this as well. Mostly as a convenience but it also might help with what you're describing. https://packagist.org/packages/neclimdul/netsuite-search-iterator |
Beta Was this translation helpful? Give feedback.
-
Hello,
i made different calls from netsuite and had faced a php memory limit (128 Mb were allocated), overcame by a memory raise. But i wonder if there is a mean to prevent this : the error occurs when i make the call, before doing anything. The preferences have been set to a max of 1000 results per page. If i reduce this max results to 100, will it reduce the amount of memory needed ? or is there another way ?
Best regards
Beta Was this translation helpful? Give feedback.
All reactions