Cã§ããã°ã©ã ãæ¸ãã¦ãã¦å¤§éã®ã¡ã¢ãªã確ä¿ããããªã£ãã¨ãã大æµã¯ mallocã使ãã¨æãã¾ããããã®éã«ã¯æ»ãå¤ãNULLãã©ãããå¤æãã¦ã¨ã©ã¼å¦çã«é£ã°ãã¨æãã¾ããããããLinux ã®ã¡ã¢ãªç®¡çãµãã·ã¹ãã ã«ã¯ãã¡ã¢ãªã»ãªã¼ãã¼ã³ããããã¨ããæ©æ§ããããå®è£ ããã¦ããã¡ã¢ãªä»¥ä¸ã®é åã確ä¿ã§ãã¦ãã¾ãã¾ãã #include <stdio.h> #include <stdlib.h> int main() { int i; char *p; for(i=0;i<65536;i++){ p = (char *)malloc(65536); if(0 == (long)p){ break; } } printf("SIZE=%dMB\n",i*65536/1024/1024); return(0); } swapoff ããã¡ã¢ãª 1G ã®ãã·ã³ã§ãããå®è¡ããã¨ãããªæãã«ãª
{{#tags}}- {{label}}
{{/tags}}