(And BTW, congratulations on being able to work with a system having at least 128 Terabytes of system RAM — or do I misinterpret the reference address of 0x7ffafc013bf8?)

With virtual memory, heap does not have to be contiguous.

This C program allocates a single page of memory starting at the 4GB base address and then doubles the base address each time until it fails:

#define _CRT_SECURE_NO_WARNINGS #include <windows.h> #include <conio.h> #include <time.h> #include "debug.h" #include "mytypes.h" int main( int argc, char **argv ) { U64 size = 4096, base = 4294967296; char *p; while( 1 ) { char *p = VirtualAllocEx( GetCurrentProcess(), (VOID*)base, size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE ); DIEIF( p == NULL ); printf( "4k allocated at:%16p (%30I64d)\n", p, 0+p ); _getch(); base *= 2; } exit( 0 ); }

I only have 8GB of ram, but the last time the above succeeds:

C:\test>vmem3 4k allocated at:0000000100000000 ( 4294967296) 4k allocated at:0000000200000000 ( 8589934592) 4k allocated at:0000000400000000 ( 17179869184) 4k allocated at:0000000800000000 ( 34359738368) 4k allocated at:0000001000000000 ( 68719476736) 4k allocated at:0000002000000000 ( 137438953472) 4k allocated at:0000004000000000 ( 274877906944) 4k allocated at:0000008000000000 ( 549755813888) 4k allocated at:0000010000000000 ( 1099511627776) 4k allocated at:0000020000000000 ( 2199023255552) 4k allocated at:0000040000000000 ( 4398046511104) [ 1916] vmem3.c(18):p == NULL failed with error 87 (The parameter is incorrect)

It allocated a page at a base address that is 4096 GB. At that point the process is only using 668k of memory.

4096GB is 2^42 which reflects that my 64-bit processor actually only has a 44-bit virtual address space.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^4: Map a string to an array by BrowserUk
in thread Map a string to an array by jess195

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.