Suppose I have two processes of 50 bytes and have only one partition (hole) of 100 bytes. Suppose the first process takes up the partition and 50 bytes is remaining . Can the second process reside in the same partition even if free space is available or will internal fragmentation occur in case of first fit?

Also is it true that if internal fragmentation is present then external fragmentation is also present?

  • $\begingroup$ What do you mean by a "process of 50 bytes"? What do you mean by a "partition"? What do you mean by a process taking up a partition? I encourage you to edit your question to provide more context and explain your terms. Are you talking about space in memory? On hard disk? If the former, what do you mean by a "partition"? $\endgroup$ – D.W. Aug 2 '17 at 0:05
  • $\begingroup$ By process, I mean process takes 50 bytes. By partition I mean free space available in terms of blocks of 100 bytes. Whether it's in main memory or in disk doesn't matter for this question right? As fragmentation can occur in RAM and disk as well. $\endgroup$ – Zephyr Aug 2 '17 at 0:10
  • 2
    $\begingroup$ The question is too general/vague to answer. I think the only answer is going to be 'it depends'. What allocation is being used? Were the 50 bytes allocated in one big contiguous allocation or in multiple smaller ones? Where is the allocator's metadata stored? Yes, it matters whether it's memory or hard disk because typically different storage mechanisms are used -- malloc() isn't going to use the same placement and allocation strategy as ext2fs, for instance. $\endgroup$ – D.W. Aug 2 '17 at 1:25
  • $\begingroup$ In other words, my question is that in first bit, best fit and other memory management techniques, can processes reside in same hole if space is available or will internal fragmentation take place by not allowing the second process to reside in the same hole? $\endgroup$ – Zephyr Aug 2 '17 at 2:28
  • 1
    $\begingroup$ Please pick one -- we want each post here to be a single question. If you have multiple questions, you can post them separately. Also, your third is "other"; that's not a memory management technique. And you still haven't answered the other questions in my comment. I encourage you to edit your question to provide additional details. (Don't just put clarifications in the comments -- we want questions to stand on their own, and be clear and read well for someone who encounters them for the first time.) Thank you. $\endgroup$ – D.W. Aug 2 '17 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.