Bump up the Navigator Metadata Server java heap size to much bigger will allow the curl command finishing successfully.
Also, for scalability in the future, we suggest to modify the custom code to use: cursorMark.
With cursorMark api, you can page through the results rather than loading everything into memory. Please take a look at the documentation on Cloudera Navigator API. From your own Navigator API console, you can read more details about cursorMark at:
Below is an example screenshot:
For example, you can use this way:
and then based on cursorMark value returns from above, run the next command with it: