See if you can share the screenshot of your error that will be good because memory issues can occur due to various reasons.
But one thing you can try is you can assign more memory by editing the conf/mapred-site.xml file and adding the property:
<property>
<name>mapred.child.java.opts</name>
<value>-Xmx1024m</value>
</property>
This will start the hadoop JVMs with more heap space.
Hope this will help in your case.