IN RTOS HAVING 1OKBYTES OF MEMORY AND YOUR PROGRAMM FOR
ASKING FOR 5KBYTES AND YOU GOT NULL ERROR ? WHY DOES IT
BEHAVES LIKE THIS
Answer Posted / laxman.vallandas
It may be becoz of two things.
1.External Fragmentation.
2.Memory leak
Due to external fragmentation 5 kb of memory will not be
allocated even though 10 kb of memory is available because
the memory is in chunks of size less than 5 kb.so wen u try
to allocate memory since malloc returns chunks of contigous
memory ,it returns NULL.
Reason 2:
If memory is allocated dynamically may be in other files or
process and which was not been deallocated yet which
results in memory leaks .
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category