Functions can release more memory than they allocate. (Note: a function can release memory allocated else where.)
For example, consider a function a() which calls b(). Say, b() allocates a string or array and returns it to a() which then uses it locally and then a() completes. In this case, b()'s memory allocation will be +ve, whereas a()'s net memory allocation will be -ve() (because it was responsible for free'ing memory allocated in b()).
Functions can release more memory than they allocate. (Note: a function can release memory allocated else where.)
For example, consider a function
a()which callsb(). Say,b()allocates a string or array and returns it toa()which then uses it locally and thena()completes. In this case,b()'s memory allocation will be+ve, whereasa()'s net memory allocation will be-ve()(because it was responsible for free'ing memory allocated inb()).