Memory utilisation

Discussion in 'Windows 64bit' started by Griff, Sep 6, 2006.

  1. Griff

    Griff Guest

    Hi

    If an application running in a 32bit version of Windows typically consumes 1
    MB of memory, would this double when moving to a 64bit environment?

    I guess this highlights my lack of knowledge of how the memory is physically
    managed. If a 2bit data type is sent to the 64bit processor, does the
    processor receive the 2 bits and 62bits of "nothing".

    Any insight into this would be most appreciated.

    Thanks in advance

    Griff
    Griff, Sep 6, 2006
    #1
    1. Advertising

  2. From one standpoint the question doesn't make sense - from another it does,
    so the answer should be Yes! and No!

    As long as we are talking about XP x64, a 32bit application will execute as
    a 32bit application, a 64bit app will execute as a 64bit app. The 32bit app
    does execute through a conversion-layer of some sort and some memory
    over-head may exist, but it will not double.

    A 64bit app that recieves a 32bit data-type will recieve it as a 64bit chunk
    of data.

    Memory is 'Byte Adressable' and no 2bit data-types exist, data cannot be
    passed as bits.


    Tony. . .


    "Griff" <> wrote in message
    news:...
    > Hi
    >
    > If an application running in a 32bit version of Windows typically consumes

    1
    > MB of memory, would this double when moving to a 64bit environment?
    >
    > I guess this highlights my lack of knowledge of how the memory is

    physically
    > managed. If a 2bit data type is sent to the 64bit processor, does the
    > processor receive the 2 bits and 62bits of "nothing".
    >
    > Any insight into this would be most appreciated.
    >
    > Thanks in advance
    >
    > Griff
    >
    >
    Tony Sperling, Sep 9, 2006
    #2
    1. Advertising

  3. The "conversion layer" is called Windows on Windows64 (WOW64). It is a thin
    emulation layer with little impact on performance.

    "Tony Sperling" <> wrote in message
    news:...
    > From one standpoint the question doesn't make sense - from another it
    > does,
    > so the answer should be Yes! and No!
    >
    > As long as we are talking about XP x64, a 32bit application will execute
    > as
    > a 32bit application, a 64bit app will execute as a 64bit app. The 32bit
    > app
    > does execute through a conversion-layer of some sort and some memory
    > over-head may exist, but it will not double.
    >
    > A 64bit app that recieves a 32bit data-type will recieve it as a 64bit
    > chunk
    > of data.
    >
    > Memory is 'Byte Adressable' and no 2bit data-types exist, data cannot be
    > passed as bits.
    >
    >
    > Tony. . .
    >
    >
    > "Griff" <> wrote in message
    > news:...
    >> Hi
    >>
    >> If an application running in a 32bit version of Windows typically
    >> consumes

    > 1
    >> MB of memory, would this double when moving to a 64bit environment?
    >>
    >> I guess this highlights my lack of knowledge of how the memory is

    > physically
    >> managed. If a 2bit data type is sent to the 64bit processor, does the
    >> processor receive the 2 bits and 62bits of "nothing".
    >>
    >> Any insight into this would be most appreciated.
    >>
    >> Thanks in advance
    >>
    >> Griff
    >>
    >>

    >
    >
    Colin Barnhorst, Sep 9, 2006
    #3
  4. Thanks, Colin.

    Since I was in the middle of something technical, I couldn't think of a
    simple way to say that!


    Tony. . .
    Tony Sperling, Sep 9, 2006
    #4
  5. Sorry, I need to correct myself one bit.

    Originally, a Byte was built from 8 bits and with the 16bit processor the
    'Word' was invented. A word was therefore 16 bits. One Byte is still 8 bits
    and any processor can still pass data in Byte size, and when it does it will
    not impact on the amount of data that is sent. You will also not see any
    efficiency boost from passing Byte size data. The Word, however, keeps being
    re-defined as the data-width is expanded, so is now 64bits. (in this here
    OS)

    This means that if a 32bit program sends a 'Word' the 64bit process recieves
    a 'Word' and each process completes the transfer according to the definition
    that it understands.

    This impacts on things like 'true numbers', and 'pointers' (memory
    adresses!) - all, things that are extensively used in modern programming.

    Hope I didn't add any further confusion here.


    Tony. . .
    Tony Sperling, Sep 9, 2006
    #5
  6. The layer is quite thin, and many 32 bit applications will actually execute
    faster under x64. Others slightly slower. But in either case, the
    differential is small.

    --
    Charlie.
    http://msmvps.com/blogs/xperts64
    "Colin Barnhorst" <colinbarharst(remove)@msn.com> wrote in message
    news:%...
    > The "conversion layer" is called Windows on Windows64 (WOW64). It is a
    > thin emulation layer with little impact on performance.
    >
    > "Tony Sperling" <> wrote in message
    > news:...
    >> From one standpoint the question doesn't make sense - from another it
    >> does,
    >> so the answer should be Yes! and No!
    >>
    >> As long as we are talking about XP x64, a 32bit application will execute
    >> as
    >> a 32bit application, a 64bit app will execute as a 64bit app. The 32bit
    >> app
    >> does execute through a conversion-layer of some sort and some memory
    >> over-head may exist, but it will not double.
    >>
    >> A 64bit app that recieves a 32bit data-type will recieve it as a 64bit
    >> chunk
    >> of data.
    >>
    >> Memory is 'Byte Adressable' and no 2bit data-types exist, data cannot be
    >> passed as bits.
    >>
    >>
    >> Tony. . .
    >>
    >>
    >> "Griff" <> wrote in message
    >> news:...
    >>> Hi
    >>>
    >>> If an application running in a 32bit version of Windows typically
    >>> consumes

    >> 1
    >>> MB of memory, would this double when moving to a 64bit environment?
    >>>
    >>> I guess this highlights my lack of knowledge of how the memory is

    >> physically
    >>> managed. If a 2bit data type is sent to the 64bit processor, does the
    >>> processor receive the 2 bits and 62bits of "nothing".
    >>>
    >>> Any insight into this would be most appreciated.
    >>>
    >>> Thanks in advance
    >>>
    >>> Griff
    >>>
    >>>

    >>
    >>

    >
    >
    Charlie Russel - MVP, Sep 9, 2006
    #6
  7. yw

    "Tony Sperling" <> wrote in message
    news:...
    > Thanks, Colin.
    >
    > Since I was in the middle of something technical, I couldn't think of a
    > simple way to say that!
    >
    >
    > Tony. . .
    >
    >
    >
    Colin Barnhorst, Sep 9, 2006
    #7
  8. Griff

    Griff Guest

    Okay - thanks for eveyone's replies. I'll try to summarise it in my own
    words and I'd then appreciate it if someone could then confirm:

    32Bit applications in 64Bit Windows
    -------------------------------------
    A 32 bit application will send out a "Word" that is 32 BIT and the
    "conversion layer" turns this into a 64 bit Word. When the result comes
    back the conversion turns the 64 bit Word back to a 32 bit Word that the
    Application can understand.

    Taking an extremely simple application. Say the application needed to hold
    just 10 variables in memory. This would consume 10 Words, or 10 x 32 Bits.
    When ever a calculation is performed on any one of these variables, there
    would be a temporary conversion to 64 bit when the variable is passed to the
    processor, so the overall memory utilisation would be "slighly greater" than
    it would be on a 32 Bit operating system.

    In terms of hardware requirements, if the application sits comfortably on a
    32 bit Windows server with 1 GB of memory then it is likely to sit
    comfortably on a 64 Bit Windows server also with 1 GB of memory.

    64 Bit application in a 64 Bit Windows
    ---------------------------------------
    If the same application code was re-compiled into 64 Bit code, then to hold
    10 variables in memory would still require the same 10 Words, but in this
    case it would now be10 x 64 Bit.

    In terms of hardware, if the 32 Bit compilation "only just" ran on a 32 Bit
    Windows server with 1 GB of memory, then the 64 bit compilation should "only
    just" now run on a 43 Bit Windows server with 2 GB of memory.
    ---------------------------------------

    Is my understanding correct?

    Thanks

    Griff
    Griff, Sep 11, 2006
    #8
  9. This, pretty much corresponds with my understanding. Most of the 'under the
    hood' activity is probably handled by the compiler so, nobody has to think
    too much about it. But the amount of memory that is consumed will not
    automatically be proportional to the number of variables you define,
    different data-types that come and go throughout the lifetime of a process
    will be reflected (to some extent) in the size of the executable, not so
    much in the memory, as all variables aren't using memory all at the same
    time. In order to have a peek on the memory itself as it is being put to
    work by the process, you would probably have to see it through a 'profiler'.
    If you contemplate having a 'go' at this and don't think you can/or want to
    pay for a fullscale programming environment, there is plenty of free stuff
    that can be scrutinized on the net.

    Your example is, of course, overly simplified. 64bit/32bit processes
    wouldn't ordinarily be talking to each other like that when they do, they
    need the conversion layer, normally, the processes just sit there and
    prepare themselves for whatever the system is feeding them, the compiler
    that created them made sure they would not recieve any data from the system
    that it could not comprehend. So, if a 32bit process hands over some data to
    the system and a 64bit process asks to be informed it might just be handed
    the 32bit value and it will itself fill out it's own data structure with
    zeros and compute it as a 64bit value as if nothing happened.

    Tony. . .


    "Griff" <> wrote in message
    news:...
    > Okay - thanks for eveyone's replies. I'll try to summarise it in my own
    > words and I'd then appreciate it if someone could then confirm:
    >
    > 32Bit applications in 64Bit Windows
    > -------------------------------------
    > A 32 bit application will send out a "Word" that is 32 BIT and the
    > "conversion layer" turns this into a 64 bit Word. When the result comes
    > back the conversion turns the 64 bit Word back to a 32 bit Word that the
    > Application can understand.
    >
    > Taking an extremely simple application. Say the application needed to

    hold
    > just 10 variables in memory. This would consume 10 Words, or 10 x 32

    Bits.
    > When ever a calculation is performed on any one of these variables, there
    > would be a temporary conversion to 64 bit when the variable is passed to

    the
    > processor, so the overall memory utilisation would be "slighly greater"

    than
    > it would be on a 32 Bit operating system.
    >
    > In terms of hardware requirements, if the application sits comfortably on

    a
    > 32 bit Windows server with 1 GB of memory then it is likely to sit
    > comfortably on a 64 Bit Windows server also with 1 GB of memory.
    >
    > 64 Bit application in a 64 Bit Windows
    > ---------------------------------------
    > If the same application code was re-compiled into 64 Bit code, then to

    hold
    > 10 variables in memory would still require the same 10 Words, but in this
    > case it would now be10 x 64 Bit.
    >
    > In terms of hardware, if the 32 Bit compilation "only just" ran on a 32

    Bit
    > Windows server with 1 GB of memory, then the 64 bit compilation should

    "only
    > just" now run on a 43 Bit Windows server with 2 GB of memory.
    > ---------------------------------------
    >
    > Is my understanding correct?
    >
    > Thanks
    >
    > Griff
    >
    >
    Tony Sperling, Sep 11, 2006
    #9
  10. no, your understanding is not correct so far as I know.

    A 32-bit program will execute a 32-bit instruction, and this will get passed
    through the "conversion" layer essentially unchanged, since there is native
    support for all those x86 instructions in the AMD64 architecture. But when
    the 32-bit program requests an OS service, such as opening a file, or
    sending a network packet, those get converted to 64 bit and passed to the
    64-bit OS. Same for any direct hardware access (and hence the requirement
    for 64bit drivers).

    --
    Charlie.
    http://msmvps.com/blogs/xperts64
    "Griff" <> wrote in message
    news:...
    > Okay - thanks for eveyone's replies. I'll try to summarise it in my own
    > words and I'd then appreciate it if someone could then confirm:
    >
    > 32Bit applications in 64Bit Windows
    > -------------------------------------
    > A 32 bit application will send out a "Word" that is 32 BIT and the
    > "conversion layer" turns this into a 64 bit Word. When the result comes
    > back the conversion turns the 64 bit Word back to a 32 bit Word that the
    > Application can understand.
    >
    > Taking an extremely simple application. Say the application needed to
    > hold just 10 variables in memory. This would consume 10 Words, or 10 x 32
    > Bits. When ever a calculation is performed on any one of these variables,
    > there would be a temporary conversion to 64 bit when the variable is
    > passed to the processor, so the overall memory utilisation would be
    > "slighly greater" than it would be on a 32 Bit operating system.
    >
    > In terms of hardware requirements, if the application sits comfortably on
    > a 32 bit Windows server with 1 GB of memory then it is likely to sit
    > comfortably on a 64 Bit Windows server also with 1 GB of memory.
    >
    > 64 Bit application in a 64 Bit Windows
    > ---------------------------------------
    > If the same application code was re-compiled into 64 Bit code, then to
    > hold 10 variables in memory would still require the same 10 Words, but in
    > this case it would now be10 x 64 Bit.
    >
    > In terms of hardware, if the 32 Bit compilation "only just" ran on a 32
    > Bit Windows server with 1 GB of memory, then the 64 bit compilation should
    > "only just" now run on a 43 Bit Windows server with 2 GB of memory.
    > ---------------------------------------
    >
    > Is my understanding correct?
    >
    > Thanks
    >
    > Griff
    >
    >
    Charlie Russel - MVP, Sep 15, 2006
    #10
  11. Griff

    Aaron Kelley Guest

    This is correct.

    Values that a 32-bit program needs to store in memory are not converted to
    64-bit. 32-bit programs execute natively under the 64-bit OS just as they
    would under the 32-bit OS, with the exceptions that under Windows x64, each
    32-bit program gets its own 4 GB address space, and that OS requests /
    system calls must be converted and passed to the OS to be handled in 64-bit
    code.

    - Aaron

    "Charlie Russel - MVP" <> wrote in message
    news:...
    > no, your understanding is not correct so far as I know.
    >
    > A 32-bit program will execute a 32-bit instruction, and this will get
    > passed through the "conversion" layer essentially unchanged, since there
    > is native support for all those x86 instructions in the AMD64
    > architecture. But when the 32-bit program requests an OS service, such as
    > opening a file, or sending a network packet, those get converted to 64 bit
    > and passed to the 64-bit OS. Same for any direct hardware access (and
    > hence the requirement for 64bit drivers).
    >
    > --
    > Charlie.
    > http://msmvps.com/blogs/xperts64
    > "Griff" <> wrote in message
    > news:...
    >> Okay - thanks for eveyone's replies. I'll try to summarise it in my own
    >> words and I'd then appreciate it if someone could then confirm:
    >>
    >> 32Bit applications in 64Bit Windows
    >> -------------------------------------
    >> A 32 bit application will send out a "Word" that is 32 BIT and the
    >> "conversion layer" turns this into a 64 bit Word. When the result comes
    >> back the conversion turns the 64 bit Word back to a 32 bit Word that the
    >> Application can understand.
    >>
    >> Taking an extremely simple application. Say the application needed to
    >> hold just 10 variables in memory. This would consume 10 Words, or 10 x
    >> 32 Bits. When ever a calculation is performed on any one of these
    >> variables, there would be a temporary conversion to 64 bit when the
    >> variable is passed to the processor, so the overall memory utilisation
    >> would be "slighly greater" than it would be on a 32 Bit operating system.
    >>
    >> In terms of hardware requirements, if the application sits comfortably on
    >> a 32 bit Windows server with 1 GB of memory then it is likely to sit
    >> comfortably on a 64 Bit Windows server also with 1 GB of memory.
    >>
    >> 64 Bit application in a 64 Bit Windows
    >> ---------------------------------------
    >> If the same application code was re-compiled into 64 Bit code, then to
    >> hold 10 variables in memory would still require the same 10 Words, but in
    >> this case it would now be10 x 64 Bit.
    >>
    >> In terms of hardware, if the 32 Bit compilation "only just" ran on a 32
    >> Bit Windows server with 1 GB of memory, then the 64 bit compilation
    >> should "only just" now run on a 43 Bit Windows server with 2 GB of
    >> memory.
    >> ---------------------------------------
    >>
    >> Is my understanding correct?
    >>
    >> Thanks
    >>
    >> Griff
    >>
    >>

    >
    Aaron Kelley, Sep 16, 2006
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David

    100% cpu utilisation

    David, Nov 24, 2004, in forum: Firefox
    Replies:
    1
    Views:
    500
    Moz Champion
    Nov 24, 2004
  2. AAW
    Replies:
    0
    Views:
    841
  3. Replies:
    2
    Views:
    1,148
  4. Replies:
    0
    Views:
    997
  5. pkcwu
    Replies:
    0
    Views:
    1,848
    pkcwu
    Nov 13, 2008
Loading...

Share This Page