This might be because, you might be allocating memory
dynamically from the heap. But care is not taken to
deallocate the same.
as a result, there are memory leaks and finally the os says
that there is no free memory
The problem is because of memory fragmentation..
Though 10KB of memory is available but it will be in
smaller chunks (less than 5KB).. when we request for 5KB
malloc returns NULL as it coudnt find a chunk of size 5KB...