Hadoop on 1GB doesn't make much sense. Also YARN is not really flexible when it comes to memory allocation. The nodemanagers get a maximum of memory they can use to schedule yarn tasks ( mapreduce, spark, ... ) yarn.nodemanager.resource.memory-mb
And a minimum which is also the multiple of task slots available
So if you have a maximum of 16GB and a minimum of 1GB he can give out up to 16 task slots to applications.
But AFAIK there is no way to dynamically change that without restarting the nodemanagers.
Yarn makes sure no task exceeds the slots it is provided but it doesn't give a damn about Operation System limits. So if you give your VM 4GB and set the yarn memory to 32GB yarn will happily schedule tasks till your system goes to its knees. You can of course enable swapping but that will result in bad performance.
So summary: Flexible memory settings on a nodemanager node is not a good idea.