1

I think the differences are:

  • In dynamic loading there is no need for OS support and it's the user's responsibility to design a program in such a way that it can benefit from dynamic loading but in demand paging, OS support is needed to manage pages. And virtual memory makes the job of programmer easier.
  • In dynamic loading we are loading routines and modules when we need them, in demand paging, we load pages when we require them.

But I think there are more differences which I missed, Any help is much appreciated!

Also this is my first question, so go easy on me:)

Null3rror
  • 105
  • 7

1 Answers1

2

Comparing dynamic loading with demand paging is like comparing driving a car with using a Content Management System. You can argue they both can help you be more efficient and get things done faster, but that is it in terms of similarities between the two.

Dynamic loading is the mechanism by which a program loads at runtime another binary (a library is considered a binary). Demand paging is an optimization technique used in virtual memory management to load pages in memory only when need (usually on a page fault).

They serve different purposes. Dynamic loading is often used for implementing a plugin system. Demand paging is just an optimization technique. They are used by different systems at different levels. One by user applications at the application level, the other by the OS, very close to the hardware, at the Virtual Memory level. They load two different things. One a binary, the other a virtual page. They use different strategies for when to load. One on explicit request, one on page fault. They use different implementation mechanisms.

Sure, you can say both use the principle of lazy loading, but this principle is applied to two different things, in two different ways to serve two different purposes.

Ultimately they are just two fundamentally different things.

bolov
  • 72,283
  • 15
  • 145
  • 224
  • I think this is appropriate: [All 3 differences](https://www.youtube.com/watch?v=86JbT5bht4A) – bolov Jan 17 '20 at 11:46