 <p>On my machine, about one second:</p> <pre><code>#include &lt;stdlib.h&gt; #include &lt;stdio.h&gt; const long long int NUM = 1024*1024*1024/8; int main(void) { long long int* ptr = malloc(NUM * sizeof ptr); printf("Gigabytes: %lld\n",NUM * sizeof ptr / 1024 / 1024 / 1024); for(int i=0;i&lt;NUM;i++) { ptr[i]=1l; } } </code></pre> <p>I then run the following (which unwillingly measures the allocation time, too:</p> <pre><code>$ gcc -O3 -std=c99 mem.c -o mem $ time ./mem Gigabytes: 1 real 0m1.056s user 0m0.205s sys 0m0.845s </code></pre>