I am new to LXD and trying to play with it. I have set limits.memory = 100MB and run a malloc program to consume all memory. I was trying to see what error I will get when accessing memory more than limit.
My process getting killed but I don’t see any error thrown.
Is it default behaviour ?/
That’s the normal Linux kernel behavior, yes.
Linux in general doesn’t throw memory errors on allocation, either you get the memory (sometimes after a delay) or you get killed by the out of memory killer.