I think memory limit issue is recursive object reference, try to fix it (skip functions in json output)