TYPO3 console - error when running cleanup:updatereferenceindex

Clash Royale CLAN TAG#URR8PPPTYPO3 console - error when running cleanup:updatereferenceindex
I get an error when running cleanup:updatereferenceindex:
typo3cms cleanup:updatereferenceindex --verbose --show-progress
Record tt_content:2823 0 indexes were added and 1 stale indexes were removed.
80424/5208014 [>---------------------------] 1% 18 secs
Record static_countries:41 4 indexes were added and 4 stale indexes were removed.
81880/5208014 [>---------------------------] 1% 19 secsKilled
...
Updating reference index. This may take a while …
81883/5208017 [>---------------------------] 1% 57 secs
mmap() failed: [12] Cannot allocate memory
Killed
What might causes this and how can I get it to run through and update the reference index?
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.