Hiya,
The AJAX Spider works by launching browsers to crawl the target, so its probably the browsers which are taking up so much memory.
By default ZAP will launch 2 x the number of available processors.
You can change that via the config param "ajaxSpider.numberOfBrowsers".
Note that your command line looks wrong to me.
I think it should be something like:
- zap-full-scan.py -t https://your-target.com -c configFile -z "-config database.request.bodysize=xxx -config ajaxSpider.numberOfBrowsers=2"
Cheers,
Simon