Pythonããã°ã©ã ãå®è¡ä¸ãã¡ã¢ãªã足ããªããªã£ãã®ã§ãã©ãã§ã©ããããæ¶è²»ãã¦ããããã§ãã¯ãã¾ãã memory_profilerã¨ããã©ã¤ãã©ãªã使ãã¾ãã ã¾ãã¯pipã§ã¤ã³ã¹ãã¼ã«ã pip install memory_profiler 使ãæ¹ã¯ç°¡åã§ã import memory_profiler @profile def hoge(): ... return ãã®ããã«é¢æ°ã®åã«@profileã¨è¨è¿°ããããã°ã©ã ã®å®è¡æã«ã python -m memory_profiler hoge.py ã¨ããã°è¯ãã§ãã 試ãã«2.21GBã®XMLãã¡ã¤ã«ãèªã¿è¾¼ãã§ã¿ãã¨ããã7700Mib â 8GBã¡ã¢ãªãæ¶è²»ãã¦ãããã¨ããããã¾ããã åè memory_profiler 0.9 : Python Package Index Pythonã³ã¼ãã®ãããã¡
{{#tags}}- {{label}}
{{/tags}}