Elasticsearch 5.2.2 - Out of memory - while indexing

I've managed to find some output from journalctl, which clearly says:

Mar 15 08:03:11 v2-es5-us kernel: Out of memory (oom_kill_allocating_task): Kill process 17552 (java) score 0 or sacrifice child
Mar 15 08:03:11 v2-es5-us kernel: Killed process 17482 (java) total-vm:38214392kB, anon-rss:2420632kB, file-rss:492624kB

Full log: