Last active
February 9, 2026 08:30
-
-
Save ryuichiueda/682b837383da783e823078569810b8d3 to your computer and use it in GitHub Desktop.
仮想メモリと確保された物理メモリの容量の違いの調査
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdlib.h> | |
| #include <unistd.h> | |
| int main() { | |
| char *p = malloc(1024*1024*1024); //1GiBメモリ確保 | |
| for(int i=0;i<1024*1024;i++) //最初の1MiBにデータ書き込み | |
| p[i] = 111; | |
| sleep(10000); //観察用にプログラムを止める | |
| exit(0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment