2

I am puzzled by this problem for a long time:

.NET EXE and DLL files both have address space. I know that they both have code space and global variable space. But I want to know whether DLLs have their own heap and stack space.

Saurabh Gokhale
  • 53,625
  • 36
  • 139
  • 164
kenny
  • 219
  • 1
  • 4
  • 13

2 Answers2

6

The process owns the heap. Each thread owns its own stack. When an EXE calls a function in a DLL the same stack is used because the function call is within the same thread.

The other point to make is that the process has the address space into which the EXE and DLL are loaded.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
2

AFAIK,

EXE:

  • Its a executable file.
  • When a system launches new exe, a new process is created

DLL

  • Its a Dynamic Link Library.

Check here for more : Differences between exe and dll

Community
  • 1
  • 1
Saurabh Gokhale
  • 53,625
  • 36
  • 139
  • 164
  • 3
    How does this answer get upvoted when it doesn't even attempt to answer the question? You have to read more than the title: *"But I want to know whether the dll have heap space and stack space."* – Cody Gray - on strike Apr 17 '11 at 09:40