Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. Memory Usage

Memory Usage

Scheduled Pinned Locked Moved System Admin
questioncssperformance
6 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    If I run the same executable in two different ways: 1) Run the exe twice from the same directory 2) Copy the exe to two different directories and run it from each directory Question 1: Will method (1) uses less physical memory than method (2)? Question 2: Is the answer to question 1 the same for both Windows and Unix?

    N 1 Reply Last reply
    0
    • L Lost User

      If I run the same executable in two different ways: 1) Run the exe twice from the same directory 2) Copy the exe to two different directories and run it from each directory Question 1: Will method (1) uses less physical memory than method (2)? Question 2: Is the answer to question 1 the same for both Windows and Unix?

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      Question 1: Will method (1) uses less physical memory than method (2)? both methods will use the same amount of memory Question 2: Is the answer to question 1 the same for both Windows and Unix? yes. on both windows and unix but the second time, it will be faster cause of paging.

      M 1 Reply Last reply
      0
      • N Nish Nishant

        Question 1: Will method (1) uses less physical memory than method (2)? both methods will use the same amount of memory Question 2: Is the answer to question 1 the same for both Windows and Unix? yes. on both windows and unix but the second time, it will be faster cause of paging.

        M Offline
        M Offline
        moliate
        wrote on last edited by
        #3

        >Question 1: Will method (1) uses less physical memory than method (2)? >both methods will use the same amount of memory I´m not so sure. This is what I learned about Win2000 (you might be right for Win9x, Nish, I only know about NT): When calling CreateProcess the system locates the .exe, creates a new process kernel object, and reserves a region of adressspace to contain the file. It then notes that the physical storage backing the region is contained on disk, instead of paging file. When the execution starts paging, buffering and caching is performed by the system. This means that both codepages and datapages are shared by all instances of a running application. When an app is changing its data (writing to the memory-mapped file), the system catches the attempt, allocates a new memoryblock, copies the data, and make changes for this process-unique page. Process 1 Code1 Code2 Data1 Process 2 Code1 Code2 Data1 Memory Code1 Code2 Data1 Data1.1 (Changed by process 1) Conclusion: More memory is used if running two (identical) .exes from different locations on disk, as the system must reserve memory for each file. Hope this will help.

        N 1 Reply Last reply
        0
        • M moliate

          >Question 1: Will method (1) uses less physical memory than method (2)? >both methods will use the same amount of memory I´m not so sure. This is what I learned about Win2000 (you might be right for Win9x, Nish, I only know about NT): When calling CreateProcess the system locates the .exe, creates a new process kernel object, and reserves a region of adressspace to contain the file. It then notes that the physical storage backing the region is contained on disk, instead of paging file. When the execution starts paging, buffering and caching is performed by the system. This means that both codepages and datapages are shared by all instances of a running application. When an app is changing its data (writing to the memory-mapped file), the system catches the attempt, allocates a new memoryblock, copies the data, and make changes for this process-unique page. Process 1 Code1 Code2 Data1 Process 2 Code1 Code2 Data1 Memory Code1 Code2 Data1 Data1.1 (Changed by process 1) Conclusion: More memory is used if running two (identical) .exes from different locations on disk, as the system must reserve memory for each file. Hope this will help.

          N Offline
          N Offline
          Nish Nishant
          wrote on last edited by
          #4

          Thanks for the info. :-) Nish Sonork ID 100.9786 voidmain

          M 1 Reply Last reply
          0
          • N Nish Nishant

            Thanks for the info. :-) Nish Sonork ID 100.9786 voidmain

            M Offline
            M Offline
            moliate
            wrote on last edited by
            #5

            Hey, I see you´ve got your login back! Great! :-D

            N 1 Reply Last reply
            0
            • M moliate

              Hey, I see you´ve got your login back! Great! :-D

              N Offline
              N Offline
              Nish Nishant
              wrote on last edited by
              #6

              Thanks Moliate :-) Yup, I got it back :-D :-D :-D :-D :-D Sonork ID 100.9786 voidmain

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups