The memory settings for the sandbox are controlled through Ambari.
You must make the changes in Ambari and restart the services. Please ensure that you have allocated enough memory to the Virtual Machine itself in VirtualBox (as it is 4GB as standard)
You must run the following commands:
login using admin/admin at 127.0.0.1:8080
From here you can change the memory settings for the various services as Ambari will overwrite any changes you make to the XML files directly.