{"id":12518,"date":"2023-10-23T08:00:00","date_gmt":"2023-10-22T23:00:00","guid":{"rendered":"https:\/\/hldc.co.jp\/blog\/?p=12518"},"modified":"2025-02-18T14:52:07","modified_gmt":"2025-02-18T05:52:07","slug":"%e3%82%a8%e3%83%bc%e3%82%b8%e3%83%b3%e3%82%b0%e3%83%ad%e3%82%b0%e3%81%ae%e6%95%b4%e7%90%86%e3%81%8c%e9%9d%a2%e5%80%92%e3%81%aa%e3%81%ae%e3%81%a7python%e3%81%ab%e3%82%84%e3%82%89%e3%81%9b%e3%81%a6-4-2","status":"publish","type":"post","link":"https:\/\/hldc.co.jp\/blog\/2023\/10\/23\/12518\/","title":{"rendered":"Python\u30a2\u30d7\u30ea\u958b\u767a<BR>\uff5e\u3010\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3011\u306e\u539f\u56e0\u3092\u8abf\u67fb\u3059\u308b\u624b\u6cd5\u307e\u3068\u3081\uff5e"},"content":{"rendered":"\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u3092\u884c\u3046\u30a8\u30f3\u30b8\u30cb\u30a2\u304c\u3001\u958b\u767a\u306e\u904e\u7a0b\u3067\u3088\u304f\u906d\u9047\u3059\u308b\u554f\u984c\u306e\u4e00\u3064\u3067\u3042\u308b\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3002<br>\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u7686\u3055\u3093\u306f\u3054\u5b58\u77e5\u306e\u901a\u308a\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u30e1\u30e2\u30ea\u3092\u9069\u5207\u306b\u89e3\u653e\u305b\u305a\u4e0d\u8981\u306a\u30e1\u30e2\u30ea\u3092\u5360\u6709\u3057\u7d9a\u3051\u308b\u73fe\u8c61\u3092\u6307\u3057\u307e\u3059\u304c\u3001\u653e\u7f6e\u3057\u3066\u3057\u307e\u3046\u3068\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u4f4e\u4e0b\u3057\u3001\u6700\u60aa\u306e\u5834\u5408\u306f\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u3082\u3002<br>\n\u3067\u3059\u306e\u3067\u3001\u65e9\u3081\u306b\u6839\u672c\u7684\u306a\u539f\u56e0\u3092\u7279\u5b9a\u3057\u89e3\u6c7a\u3059\u308b\u3053\u3068\u304c\u5fc5\u8981\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306e\u30d6\u30ed\u30b0\u3067\u306f\u3001Python\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u4e2d\u306b\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u767a\u751f\u3057\u305f\u969b\u306b\u884c\u3063\u305f\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u7b49\u306e\u6e2c\u5b9a\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<br>\n\u307f\u306a\u3055\u307e\u306e\u53c2\u8003\u306b\u306a\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"box_border_gray\">\n<h5 class=\"wp-block-heading\">CONTENTS<\/h5>\n<ol>\n\n<li><a href=\"#cont1\">\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u306f\uff1f<\/a>\n\n<ul>\n\n<li><a href=\"#cont1-1\">Python\u306e\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066<\/a><\/li>\n\n\n<li><a href=\"#cont1-2\">\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u8d77\u304d\u3084\u3059\u3044\u4f8b<\/a><\/li>\n\n<\/ul>\n\n<\/li>\n\n\n<li><a href=\"#cont2\">\u30e1\u30e2\u30ea\u5360\u6709\u7387\u306e\u6e2c\u5b9a &#8211; memory_profiler<\/a><\/li>\n\n\n<li><a href=\"#cont3\">\u4eee\u60f3\u30e1\u30e2\u30ea\u60c5\u5831\u306e\u53d6\u5f97 &#8211; virtual_memory()<\/a><\/li>\n\n\n<li><a href=\"#cont4\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30b5\u30a4\u30ba\u306e\u6e2c\u5b9a &#8211; size_of()\u3001getsizeof()<\/a><\/li>\n\n\n<li><a href=\"#cont5\" data-type=\"internal\" data-id=\"#cont6\">\u307e\u3068\u3081<\/a><\/li>\n\n<\/ol>\n<\/div>\n\n\n\n<div id=\"cont1\" class=\"anchor\">&nbsp;<\/div>\n\n\n\n<h2 class=\"wp-block-heading title\">\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u52d5\u7684\u306b\u30e1\u30e2\u30ea\u3092\u5272\u308a\u5f53\u3066\u305f\u3042\u3068\u3001\u30e1\u30e2\u30ea\u304c\u9069\u5207\u306b\u958b\u653e\u3055\u308c\u306a\u3044\u5834\u5408\u306b\u767a\u751f\u3057\u307e\u3059\u3002\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306b\u3088\u3063\u3066\u3001\u30e1\u30e2\u30ea\u304c\u4e0d\u8db3\u3059\u308b\u3068\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u52d5\u4f5c\u304c\u4e0d\u5b89\u5b9a\u306b\u306a\u3063\u305f\u308a\u3001\u30af\u30e9\u30c3\u30b7\u30e5\u3084\u30d5\u30ea\u30fc\u30ba\u3092\u5f15\u304d\u8d77\u3053\u3059\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<br> <br> Python\u3067\u306f\u3001\u30e1\u30e2\u30ea\u7ba1\u7406\u3092\u81ea\u52d5\u3067\u884c\u3063\u3066\u304f\u308c\u308b\u4ed5\u7d44\u307f\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div id=\"cont1-1\" class=\"anchor\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading underline\">Python\u306e\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066<\/h4>\n\n\n\n<p>Python\u306b\u306f\u3001\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\uff08GC\uff09\u3068\u3044\u3046\u4e0d\u8981\u306a\u30e1\u30e2\u30ea\u30ea\u30bd\u30fc\u30b9\u3092\u81ea\u52d5\u7684\u306b\u89e3\u653e\u3059\u308b\u4ed5\u7d44\u307f\u304c\u3042\u308a\u3001\u30d7\u30ed\u30b0\u30e9\u30de\u304c\u624b\u52d5\u3067\u30e1\u30e2\u30ea\u7ba1\u7406\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002<br> Python\u306b\u306f\u5927\u304d\u304f\u5206\u3051\u3066\u30012\u3064\u306e\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u5b9f\u884c\u6761\u4ef6\u304c\u3042\u308a\u307e\u3059\u3002 <\/p>\n\n\n<div class=\"box_border_gray\">\n<h5>\u53c2\u7167\u30ab\u30a6\u30f3\u30bf\u65b9\u5f0f<\/h5>\n<p>\n\u30fb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3054\u3068\u306b\u53c2\u7167\u30ab\u30a6\u30f3\u30bf\u304c\u4fdd\u6301\u3055\u308c\u3001\u53c2\u7167\u56de\u6570\u304c\u5c11\u306a\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30e1\u30e2\u30ea\u3092\u3001\u81ea\u52d5\u7684\u306b\u89e3\u653e\u3059\u308b<br \/>\n\u30fb\u5faa\u74b0\u53c2\u7167\uff08\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u9593\u3067\u76f8\u4e92\u306b\u53c2\u7167\u304c\u3042\u308a\u3001\u305d\u306e\u7d50\u679c\u53c2\u7167\u30ab\u30a6\u30f3\u30bf\u304c\u30bc\u30ed\u306b\u306a\u3089\u306a\u3044\u72b6\u6cc1\uff09\u306b\u5bfe\u5fdc\u3067\u304d\u306a\u3044<br \/>\u3000\u4f8b\uff1aa=a+1\n<\/p>\n<h5>\u4e16\u4ee3\u5225\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3<\/h5>\n<p>\n\u30fb\u30e1\u30e2\u30ea\u306e\u7ba1\u7406\u3092\u52b9\u7387\u5316\u3059\u308b\u305f\u3081\u306b\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u4e16\u4ee3\u306b\u5206\u3051\u3089\u308c\u6700\u521d\u306e\u4e16\u4ee3\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u983b\u7e41\u306b\u53ce\u96c6\u3055\u308c\u308b<br \/>\n\u30fb\u53c2\u7167\u30ab\u30a6\u30f3\u30bf\u3067\u62fe\u3044\u304d\u308c\u306a\u3044\u90e8\u5206\u3092\u88dc\u3046\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u308b\n<\/p>\n<\/div>\n\n\n\n<div id=\"cont1-2\" class=\"anchor\"><\/div>\n\n\n\n<h4 class=\"wp-block-heading underline\">\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u8d77\u304d\u3084\u3059\u3044\u4f8b<\/h4>\n\n\n\n<p>\u3067\u306f\u3001Python\u30a2\u30d7\u30ea\u958b\u767a\u3067\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u8d77\u304d\u3084\u3059\u3044\u306e\u306f\u3001\u3069\u306e\u3088\u3046\u306a\u5834\u5408\u3067\u3057\u3087\u3046\u304b\u3002 \u8abf\u3079\u3066\u307f\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u72b6\u6cc1\u306e\u6642\u306b\u7279\u306b\u8d77\u304d\u3084\u3059\u3044\u3088\u3046\u3067\u3059\u3002 <\/p>\n\n\n<div class=\"box_border_gray\">\n<h5>\u4e0d\u8981\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u524a\u9664\u6f0f\u308c<\/h5>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u4e0d\u8981\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3078\u306e\u53c2\u7167\u3092\u4fdd\u6301\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u305d\u308c\u3089\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u30e1\u30e2\u30ea\u5185\u306b\u6b8b\u308a\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306e\u539f\u56e0\u3068\u306a\u308b\u3002<\/p>\n<h5>\u5faa\u74b0\u53c2\u7167<\/h5>\n<p>Python\u3067\u306f\u5faa\u74b0\u53c2\u7167\u304c\u8d77\u3053\u308a\u3084\u3059\u304f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8A\u3068\u30aa\u30d6\u30b8\u30a7\u30af\u30c8B\u304c\u304a\u4e92\u3044\u306b\u53c2\u7167\u3057\u5408\u3046\u3068\u53c2\u7167\u3092\u89e3\u653e\u3067\u304d\u305a\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u767a\u751f\u3059\u308b\u3002<\/p>\n<h5>\u8f9e\u66f8\u578b\u306e\u4f7f\u7528<\/h5>\n<p>\u8f9e\u66f8\u578b\uff08dict\uff09\u306f\u53ef\u5909\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3042\u308a\u3001\u5927\u304d\u306a\u8f9e\u66f8\u3092\u4e0d\u8981\u306a\u307e\u307e\u4fdd\u6301\u3057\u3066\u304a\u304f\u3068\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u751f\u3058\u308b\u3002<br \/>\n\u95a2\u6570\u306e\u30ea\u30bf\u30fc\u30f3\u304c\u8f9e\u66f8\u578b\u3067\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u751f\u3058\u308b\u306e\u3067\u3001yield\u3092\u4f7f\u7528\u3057\u30661\u884c\u3054\u3068\u51fa\u529b\u3059\u308b\u7b49\u5024\u3092\u8fd4\u3059\u3002\n<\/p>\n<\/div>\n\n\n\n<p>\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u767a\u751f\u3057\u3066\u3057\u307e\u3063\u305f\u5834\u5408\u3001\u3069\u306e\u3088\u3046\u306b\u539f\u56e0\u3092\u7279\u5b9a\u3057\u3066\u3044\u304f\u306e\u304b\u3002<br>\n\u554f\u984c\u89e3\u6c7a\u306e\u305f\u3081\u306e\u4fbf\u5229\u306a\u30c4\u30fc\u30eb\u3092\u3054\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div id=\"cont2\" class=\"anchor\">&nbsp;<\/div>\n\n\n\n<h2 class=\"wp-block-heading title\">\u30e1\u30e2\u30ea\u5360\u6709\u7387\u306e\u6e2c\u5b9a &#8211; memory_profiler<\/h2>\n\n\n\n<p>\u307e\u305a\u306f\u30e1\u30e2\u30ea\u30d7\u30ed\u30d5\u30a1\u30a4\u30ea\u30f3\u30b0\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u3069\u306e\u90e8\u5206\u3067\u30e1\u30e2\u30ea\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u6e2c\u5b9a\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306e\u767a\u751f\u6e90\u3092\u7279\u5b9a\u3067\u304d\u307e\u3059\u3002<br>\u4eca\u56de\u4f7f\u7528\u3057\u305f\u306e\u306f\u3001Python\u306e\u30e1\u30e2\u30ea\u30d7\u30ed\u30d5\u30a1\u30a4\u30ea\u30f3\u30b0\u30c4\u30fc\u30eb\u300cmemory_profiler\u300d\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u4e8b\u524d\u6e96\u5099<\/h4>\n\n\n\n<p>memory_profiler\u3068psutil\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u3001pip\u3092\u4f7f\u7528\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"monokai\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># memory_profiler\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\n$ pip install -U memory_profiler\n\n# psutil\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\n$ pip install psutil<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u958b\u767a\u74b0\u5883\u3078\u306e\u5b9f\u88c5<\/h4>\n\n\n\n<p>\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb(test.sh)\u5185\u306ehandle.py\u306e\u5b9f\u884c\u90e8\u5206\u3092\u4ee5\u4e0b\u306b\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<br>(memory_profile\u306b\u3088\u308b\u8ffd\u52a0\u306f&#8221;-m memory_profiler&#8221;)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"monokai\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">python3 -B -m memory_profiler  .\/handler.py $test_root<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>&#8220;-o &lt;\u51fa\u529b\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u540d&gt;.log&#8221;\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u8a2d\u5b9a\u306b\u3088\u308a\u3001\u5b9f\u884c\u74b0\u5883\u306epython\u4ee5\u4e0b\u306b\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u306elog\u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u8a08\u6e2c\u3057\u305f\u3044\u95a2\u6570\u306e\u5b9a\u7fa9\u4f4d\u7f6e\u306b\u3066\u3001\u30c7\u30b3\u30ec\u30fc\u30bf(@profile)\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\"><code>@profile<\/code><br><code>def&lt;\u8a08\u6e2c\u5bfe\u8c61\u306e\u95a2\u6570&gt;:<\/code><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from memory_profiler import profile\n\nLEN = 10000\n\n@profile\ndef memory_profile_sample():\n    # \u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8\n    a = [i for i in range(10000)]\n    # \u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8\u3092\u524a\u9664\u3059\u308b\n    del a\n    # \u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8\n    b = [i for i in range(100)]\n    # \u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8\u3092\u524a\u9664\u3059\u308b\n    del b\n\nmemory_profile_sample()\n<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u5b9f\u884c\u7d50\u679c<\/h4>\n\n\n\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4e0b\u56f3\u306e\u901a\u308a\u3001\u30e1\u30e2\u30ea\u5360\u6709\u7387\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"monokai\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Line #    Mem usage    Increment  Occurrences   Line Contents\n=============================================================\n    5     11.5 MiB     11.5 MiB           1    @profile\n    6                                          def memory_profile_sample():\n    7                                              # \u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8                                               \n    8     67.3 MiB     55.8 MiB       10000        a = [i for i in range(10000)]\n    9                                              # \u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8\u3092\u524a\u9664\u3059\u308b                                         \n   10     11.9 MiB     -55.4 MiB          1        del a\n   11                                              # \u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8                                         \n   12     11.9 MiB      0.0 MiB         100        b = [i for i in range(100)]\n   13                                              # \u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8\u3092\u524a\u9664\u3059\u308b                                        \n   14     11.9 MiB      0.0 MiB           1        del b<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">memory_profiler\u3067\u306e\u6e2c\u5b9a\u306e\u3001\u30e1\u30ea\u30c3\u30c8\u3068\u30c7\u30e1\u30ea\u30c3\u30c8<\/h4>\n\n\n<div class=\"box_border_gray\">\n<h5>\u30e1\u30ea\u30c3\u30c8<\/h5>\n<p>\u8abf\u67fb\u7bc4\u56f2\u304c\u5e83\u3044\u6642\u306b\u6709\u52b9\u3002\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5909\u66f4\u91cf\u304c\u5c11\u306a\u3044\u3002<\/p>\n<h5>\u30c7\u30e1\u30ea\u30c3\u30c8<\/h5>\n<p>\u7e70\u308a\u8fd4\u3057\u547c\u3073\u51fa\u3055\u308c\u308b\u3068\u6e2c\u5b9a\u7b87\u6240\u304c\u4e0d\u660e\u77ad\u306b\u306a\u308b\u3002\u51e6\u7406\u901f\u5ea6\u304c\u9045\u304f\u306a\u308b\u3002<\/p>\n<\/div>\n\n\n\n<h4 class=\"wp-block-heading\">\u6642\u7cfb\u5217\u306e\u30b0\u30e9\u30d5\u306e\u51fa\u529b<\/h4>\n\n\n\n<p>matplotlib\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3042\u308c\u3070<br>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6642\u7cfb\u5217\u306e\u30b0\u30e9\u30d5\u3092\u51fa\u529b\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">\u3000\u2022mprof&nbsp; run &lt;\u30b9\u30af\u30ea\u30d7\u30c8&gt;<br>\u3000\u2022mprof plot<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"597\" height=\"386\" src=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/09\/10-3.png\" alt=\"\" class=\"wp-image-12535\" srcset=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/09\/10-3.png 597w, https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/09\/10-3-300x194.png 300w\" sizes=\"(max-width: 597px) 100vw, 597px\" \/><\/figure>\n\n\n\n<div id=\"cont3\" class=\"anchor\">&nbsp;<\/div>\n\n\n\n<h2 class=\"wp-block-heading title\">\u4eee\u60f3\u30e1\u30e2\u30ea\u60c5\u5831\u306e\u53d6\u5f97 &#8211; virtual_memory()<\/h2>\n\n\n\n<p>virtual_memory()\u95a2\u6570\u306f\u3001Python\u306epsutil\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u95a2\u6570\u306e\u4e00\u3064\u3067\u3059\u3002<br>Bash\u306efree\u30b3\u30de\u30f3\u30c9\u3068\u540c\u69d8\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u4eee\u60f3\u30e1\u30e2\u30ea\u306e\u5408\u8a08\u30b5\u30a4\u30ba\u3001\u4f7f\u7528\u91cf\u3001\u7a7a\u304d\u5bb9\u91cf\u3001\u4eee\u60f3\u30e1\u30e2\u30ea\u306e\u30da\u30fc\u30b8\u30f3\u30b0\u7d71\u8a08\u306a\u3069\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3067\u304d\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u30b7\u30b9\u30c6\u30e0\u306e\u30e1\u30e2\u30ea\u30ea\u30bd\u30fc\u30b9\u3092\u52b9\u679c\u7684\u306b\u5229\u7528\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u4f7f\u7528\u65b9\u6cd5<\/h4>\n\n\n\n<p>\u52d5\u4f5c\u74b0\u5883\u306b\u3001psutil\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br>\u4f7f\u7528\u3057\u305f\u3044\u30b9\u30af\u30ea\u30d7\u30c8\u306bpsutil\u3092import\u3057\u3066\u3001\u78ba\u8a8d\u3057\u305f\u3044\u7b87\u6240\u3067psutil.virtual_memory()\u3092\u547c\u3073\u51fa\u3057\u3001\u30ed\u30b0\u306b\u51fa\u529b\u3057\u307e\u3059\u3002<br>\u5f15\u6570\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u4f7f\u7528\u91cf\u3001\u7a7a\u304d\u5bb9\u91cf\u7b49\u306e\u6307\u5b9a\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import psutil\n\nmem = psutil.virtual_memory() \n\nprint(f\"\u5168\u4f53\u91cf\uff1a{mem.total}\")\nprint(f\"\u4f7f\u7528\u7387\uff1a{mem.percent}\")\nprint(f\"\u4f7f\u7528\u91cf\uff1a{mem.used}\")\nprint(f\"\u7a7a\u304d\u5bb9\u91cf\uff1a{mem.free}\")\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u5b9f\u884c\u7d50\u679c<\/h4>\n\n\n\n<p>\u4e0b\u56f3\u306e\u901a\u308a\u3001\u30e1\u30e2\u30ea\u306e\u4f7f\u7528\u91cf\u7b49\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"monokai\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u5168\u4f53\u91cf\uff1a8589934592\n\u4f7f\u7528\u7387\uff1a41.5\n\u4f7f\u7528\u91cf\uff1a3567390138\n\u7a7a\u304d\u5bb9\u91cf\uff1a5022544454<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">virtual_memory()\u3067\u306e\u6e2c\u5b9a\u306e\u3001\u30e1\u30ea\u30c3\u30c8\u3068\u30c7\u30e1\u30ea\u30c3\u30c8 <\/h4>\n\n\n<div class=\"box_border_gray\">\n<h5>\u30e1\u30ea\u30c3\u30c8<\/h5>\n<p>\u7e70\u308a\u8fd4\u3057\u547c\u3076\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u3082\u6709\u52b9\u3002\u51e6\u7406\u3082\u8efd\u3044\u3002<\/p>\n<h5>\u30c7\u30e1\u30ea\u30c3\u30c8<\/h5>\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5909\u66f4\u91cf\u304c\u5897\u3048\u308b\u3002\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u81ea\u4f53\u306e\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u304c\u4e0d\u660e\u77ad\u3002<\/p>\n<\/div>\n\n\n\n<div id=\"cont4\" class=\"anchor\">&nbsp;<\/div>\n\n\n\n<h2 class=\"wp-block-heading title\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30b5\u30a4\u30ba\u306e\u6e2c\u5b9a &#8211; __size_of_()\u3001getsizeof()<\/h2>\n\n\n\n<p>__size_of_()\u3084getsizeof()\u95a2\u6570\u3092\u7528\u3044\u308b\u3068\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30b5\u30a4\u30ba\u3092\u8abf\u3079\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306e\u500b\u5225\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u7279\u5b9a\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u53d6\u5f97\u3055\u308c\u308b\u30b5\u30a4\u30ba\u306e\u5358\u4f4d\u306f\u30d0\u30a4\u30c8\u306b\u306a\u308a\u307e\u3059\u3002<br><\/p>\n\n\n\n<p>getsizeof()\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001sys\u3092import\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"atomic\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from memory_profiler import profile\nimport sys\n\nLEN = 10000\n\n@profile\ndef memory_profile_sample():\n    # \u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8\n    a = [i for i in range(100000)]\n    # \u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8\u306e\u30b5\u30a4\u30ba\u3092\u51fa\u529b\n    print(f\"\u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8\u306e\u30b5\u30a4\u30ba\u306f\uff1a{a.__sizeof__()}\")\n    # \u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8\u3092\u524a\u9664\u3059\u308b\n    del a\n    # \u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8\n    b = [i for i in range(100)]\n    # \u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8\u306e\u30b5\u30a4\u30ba\u3092\u51fa\u529b\n    print(f\"\u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8\u306e\u30b5\u30a4\u30ba\u306f\uff1a{sys.getsizeof(b)}\")\n        # \u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8\u3092\u524a\u9664\u3059\u308b\n    del b\n\nmemory_profile_sample()\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u5b9f\u884c\u7d50\u679c<\/h4>\n\n\n\n<p> \u4e0b\u56f3\u306e\u901a\u308a\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30b5\u30a4\u30ba\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"monokai\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8\u306e\u30b5\u30a4\u30ba\u306f\uff1a8000412\n\u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8\u306e\u30b5\u30a4\u30ba\u306f\uff1a8067\nFilename: \/home\/user\/sample\/memory_profile_sample.py\n\nLine #    Mem usage    Increment  Occurrences   Line Contents\n=============================================================\n    6     22.9 MiB     22.9 MiB           1     @profile\n    7                                           def memory_profile_sample():\n    8                                               # \u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8                                              \n    9     26.8 MiB      3.9 MiB      100000         a = [i for i in range(100000)]\n   10                                               # \u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8\u306e\u30b5\u30a4\u30ba\u3092\u51fa\u529b                                         \n   11     26.8 MiB      0.0 MiB           1         print(f\"\u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8\u306e\u30b5\u30a4\u30ba\u306f\uff1a{a.__sizeof__()}\") \n   12                                               # \u5927\u304d\u3081\u306e\u30ea\u30b9\u30c8\u3092\u524a\u9664\u3059\u308b                                         \n   13     23.4 MiB     -3.4 MiB           1         del a\n   14                                               # \u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8                                         \n   15     23.4 MiB      0.0 MiB         100         b = [i for i in range(100)]\n   16                                               # \u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8\u306e\u30b5\u30a4\u30ba\u3092\u51fa\u529b                                         \n   17     23.4 MiB      0.0 MiB           1         print(f\"\u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8\u306e\u30b5\u30a4\u30ba\u306f\uff1a{sys.getsizeof(b)}\")\n   18                                               # \u5c0f\u3055\u3081\u306e\u30ea\u30b9\u30c8\u3092\u524a\u9664\u3059\u308b                                        \n   19     23.4 MiB      0.0 MiB           1         del b\n<\/pre>\n\n\n\n<div id=\"cont5\" class=\"anchor\">&nbsp;<\/div>\n\n\n\n<h2 class=\"wp-block-heading title\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<br>Python\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u4e0a\u3067\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306f\u9762\u5012\u306a\u554f\u984c\u3067\u3059\u3002<br>\u3067\u3082\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5b89\u5b9a\u6027\u3068\u6027\u80fd\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u53ca\u307c\u3059\u554f\u984c\u3067\u3059\u306e\u3067\u3001<br>\u4eca\u56de\u3054\u7d39\u4ecb\u3057\u305f\u624b\u6cd5\u306a\u3069\u3092\u4f7f\u3063\u3066\u3001\u65e9\u3081\u306b\u539f\u56e0\u306e\u7279\u5b9a\u3092\u884c\u3063\u3066\u554f\u984c\u3092\u89e3\u6c7a\u3057\u3066\u3044\u304d\u305f\u3044\u3067\u3059\u306d\uff01<\/p>\n\n\n\n<p><\/p>\n\n\n<div class=\"box_border_gray\">\n<h3 id=\"seminar_title\">\u30cf\u30fc\u30c8\u30e9\u30f3\u30c9\u30fb\u30c7\u30fc\u30bf\u3068\u3044\u3048\u3070\u52d5\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3010DT+\u3011<\/h3>\n<div class='one_half'>\n\t\t\t\t\t<img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full\" src=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2021\/12\/df98a638b295348fdd6e42fb4e05853e.png\" alt=\"\" width=\"500\" height=\"375\">\n\t\t\t\t<\/div>\n<div class='one_half et_column_last'>\n\t\t\t\t\t\u5b9f\u6a5f\u3092\u52d5\u304b\u3057\u3066\u3001\u300c\u30ca\u30de\u306e\u6319\u52d5\u300d\u3092\u89e3\u6790\u3059\u308b\u52d5\u7684\u89e3\u6790\u3002\n\u30bd\u30d5\u30c8\u306e\u5b9f\u884c\u7d4c\u8def\u3084\u5b9f\u884c\u6642\u9593\u304b\u3089\u3001\u30cf\u30fc\u30c9\u5074\u306e\u6319\u52d5\u307e\u3067\uff01\u5168\u90e8\u3072\u3068\u624b\u9593\u3067\u89e3\u6790\u3067\u304d\u307e\u3059\u3002<\/p>\n<p style=\"padding-top: 15px;\">\n<a class=\"button button-blue\" target=\"_blank\" href=\"https:\/\/hldc.co.jp\/product_service\/development\/dtplus\/dtplus-trace\/\" onclick=\"gtag('event', 'Click', {'event_category': 'WebLink','event_label': 'toDTplus\u88fd\u54c1\u30da\u30fc\u30b8_from12518});\">DT+\u306e\u8a73\u7d30\u306f\u3053\u3061\u3089<\/a>\n<\/p>\n\t\t\t\t<\/div><div class='clear'><\/div><\/div>\n\n\n<div class=\"box_border_gray\">\n<h5>\u3010 \u7121\u6599\u3067\u307f\u308c\u308b\uff01 \u3011<br \/>\n\u52d5\u7684\u30c6\u30b9\u30c8\u30c4\u30fc\u30ebDT+ \u30c7\u30e2\u52d5\u753b<\/h5>\n<figure><img decoding=\"async\" class=\"aligncenter wp-image-14406 size-large\" src=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2024\/09\/bnr_dtplus_demo_video.png\" alt=\"\" width=\"1024\" srcset=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2024\/09\/bnr_dtplus_demo_video.png 1185w, https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2024\/09\/bnr_dtplus_demo_video-300x114.png 300w, https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2024\/09\/bnr_dtplus_demo_video-1024x390.png 1024w, https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2024\/09\/bnr_dtplus_demo_video-768x292.png 768w, https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2024\/09\/bnr_dtplus_demo_video-1080x411.png 1080w\" sizes=\"(max-width: 1185px) 100vw, 1185px\" \/><\/figure>\n<p style=\"margin:20px 0;\">\n\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u958b\u767a\u8005\u306e\u305f\u3081\u306e\u52d5\u7684\u30c6\u30b9\u30c8\u30c4\u30fc\u30eb\u300cDT+\u300d\u3092\u3054\u7d39\u4ecb\u3059\u308b\u52d5\u753b\u3067\u3059\u3002<br \/>\n\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5b9f\u884c\u306b\u3088\u308a\u30ed\u30b0\u3092\u53ce\u96c6\u3057\u3001\u591a\u5f69\u306a\u89e3\u6790\u6a5f\u80fd\u306b\u3088\u308a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u52d5\u4f5c\u3092\u3053\u307e\u304b\u304f\u898b\u3048\u308b\u5316\u3002\u305f\u3063\u305f\u6570\u30af\u30ea\u30c3\u30af\u306e\u89e3\u6790\u3067\u3001\u95a2\u6570\u9077\u79fb\u3084\u5909\u6570\u306e\u5909\u52d5\u3001\u30ab\u30d0\u30ec\u30c3\u30b8\u3092\u30b0\u30e9\u30d5\u30a3\u30ab\u30eb\u306b\u8868\u793a\u3057\u307e\u3059\u3002\u672c\u52d5\u753b\u3067\u306f\u3001\u305d\u3093\u306aDT+\u306e\u5c0e\u5165\u624b\u6cd5\u304b\u3089\u5b9f\u969b\u306e\u89e3\u6790\u306e\u69d8\u5b50\u307e\u3067\u3001\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u3092\u30c7\u30e2\u30f3\u30b9\u30c8\u30ec\u30fc\u30b7\u30e7\u30f3\u3044\u305f\u3057\u307e\u3059\u3002\n<\/p>\n<a class=\"button button-blue\" target=\"_blank\" href=\"https:\/\/go.hldc.co.jp\/dtplus-demo-video\" onclick=\"gtag('event', 'Click', {'event_category': 'WebLink','event_label': 'toDTPlus\u30c7\u30e2\u52d5\u753b_from12518'});\" style=\"margin-top:10px;\">\u304a\u7533\u3057\u8fbc\u307f\u306f\u3053\u3061\u3089\uff01<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u3092\u884c\u3046\u30a8\u30f3\u30b8\u30cb\u30a2\u304c\u3001\u958b\u767a\u306e\u904e\u7a0b\u3067\u3088\u304f\u906d\u9047\u3059\u308b\u554f\u984c\u306e\u4e00\u3064\u3067\u3042\u308b\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3002\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3092\u653e\u7f6e\u3057\u3066\u3057\u307e\u3046\u3068\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u4f4e\u4e0b\u3057\u3001\u6700\u60aa\u306e\u5834\u5408\u306f\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u3082\u3002\u4eca\u56de\u306e\u30d6\u30ed\u30b0\u3067\u306f\u3001Python\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u4e2d\u306b\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u767a\u751f\u3057\u305f\u969b\u306b\u884c\u3063\u305f\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u7b49\u306e\u6e2c\u5b9a\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3054\u7d39\u4ecb\u3057\u307e\u3059\uff01<\/p>\n","protected":false},"author":10,"featured_media":12657,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"<!-- wp:paragraph -->\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u3092\u884c\u3046\u30a8\u30f3\u30b8\u30cb\u30a2\u304c\u3001\u958b\u767a\u306e\u904e\u7a0b\u3067\u3088\u304f\u906d\u9047\u3059\u308b\u554f\u984c\u306e\u4e00\u3064\u3067\u3042\u308b\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3002<br>\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u7686\u3055\u3093\u306f\u3054\u5b58\u77e5\u306e\u901a\u308a\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u30e1\u30e2\u30ea\u3092\u9069\u5207\u306b\u89e3\u653e\u305b\u305a\u4e0d\u8981\u306a\u30e1\u30e2\u30ea\u3092\u5360\u6709\u3057\u7d9a\u3051\u308b\u73fe\u8c61\u3092\u6307\u3057\u307e\u3059\u304c\u3001\u653e\u7f6e\u3057\u3066\u3057\u307e\u3046\u3068\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u4f4e\u4e0b\u3057\u3001\u6700\u60aa\u306e\u5834\u5408\u306f\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u3082\u3002<br>\n\u3067\u3059\u306e\u3067\u3001\u65e9\u3081\u306b\u6839\u672c\u7684\u306a\u539f\u56e0\u3092\u7279\u5b9a\u3057\u89e3\u6c7a\u3059\u308b\u3053\u3068\u304c\u5fc5\u8981\u3067\u3059\u306d\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>\u4eca\u56de\u306e\u30d6\u30ed\u30b0\u3067\u306f\u3001Python\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u4e2d\u306b\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u767a\u751f\u3057\u305f\u969b\u306b\u884c\u3063\u305f\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u7b49\u306e\u6e2c\u5b9a\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<br>\n\u307f\u306a\u3055\u307e\u306e\u53c2\u8003\u306b\u306a\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:heading {\"level\":5} -->\n<h5>CONTENTS<\/h5>\n<!-- \/wp:heading -->\n\n<!-- wp:list {\"ordered\":true,\"className\":\"box_border_gray\"} -->\n<ol class=\"box_border_gray\" style=\"list-style-type: none;\"><li><a href=\"#cont1\">\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u306f\uff1f<\/a><\/li><li><a href=\"#cont1-1\">\u3000- Python\u306e\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066<\/a><\/li><li><a href=\"#cont1-2\">\u3000- \u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u8d77\u304d\u3084\u3059\u3044\u4f8b<\/a><\/li><li><a href=\"#cont2\">\u30e1\u30e2\u30ea\u5360\u6709\u7387\u306e\u6e2c\u5b9a - memory_profiler<\/a><\/li><li><a href=\"#cont3\">\u4eee\u60f3\u30e1\u30e2\u30ea\u60c5\u5831\u306e\u53d6\u5f97 - virtual_memory()<\/a><\/li><li><a href=\"#cont4\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30b5\u30a4\u30ba\u306e\u6e2c\u5b9a - size_of()\u3001getsizeof()<\/a><\/li><li><a href=\"#cont5\" data-type=\"internal\" data-id=\"#cont6\">\u307e\u3068\u3081<\/a><\/li><\/ol>\n<!-- \/wp:list -->\n\n<!-- wp:html -->\n<div id=\"cont1\" class=\"anchor\">&nbsp;<\/div>\n<!-- \/wp:html -->\n\n<!-- wp:heading {\"className\":\"title\"} -->\n<h2 class=\"title\">\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u306f\uff1f<\/h2>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u52d5\u7684\u306b\u30e1\u30e2\u30ea\u3092\u5272\u308a\u5f53\u3066\u305f\u3042\u3068\u3001\u30e1\u30e2\u30ea\u304c\u9069\u5207\u306b\u958b\u653e\u3055\u308c\u306a\u3044\u5834\u5408\u306b\u767a\u751f\u3057\u307e\u3059\u3002\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306b\u3088\u3063\u3066\u3001\u30e1\u30e2\u30ea\u304c\u4e0d\u8db3\u3059\u308b\u3068\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u52d5\u4f5c\u304c\u4e0d\u5b89\u5b9a\u306b\u306a\u3063\u305f\u308a\u3001\u30af\u30e9\u30c3\u30b7\u30e5\u3084\u30d5\u30ea\u30fc\u30ba\u3092\u5f15\u304d\u8d77\u3053\u3059\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<br> <br> Python\u3067\u306f\u3001\u30e1\u30e2\u30ea\u7ba1\u7406\u3092\u81ea\u52d5\u3067\u884c\u3063\u3066\u304f\u308c\u308b\u4ed5\u7d44\u307f\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u767a\u751f\u3059\u308b\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:html -->\n<div id=\"cont1-1\" class=\"anchor\"><\/div>\n<!-- \/wp:html -->\n\n<!-- wp:heading {\"level\":4,\"className\":\"underline\"} -->\n<h4 class=\"underline\">Python\u306e\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066<\/h4>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>Python\u306b\u306f\u3001\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\uff08GC\uff09\u3068\u3044\u3046\u4e0d\u8981\u306a\u30e1\u30e2\u30ea\u30ea\u30bd\u30fc\u30b9\u3092\u81ea\u52d5\u7684\u306b\u89e3\u653e\u3059\u308b\u4ed5\u7d44\u307f\u304c\u3042\u308a\u3001\u30d7\u30ed\u30b0\u30e9\u30de\u304c\u624b\u52d5\u3067\u30e1\u30e2\u30ea\u7ba1\u7406\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002<br> Python\u306b\u306f\u5927\u304d\u304f\u5206\u3051\u3066\u30012\u3064\u306e\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u5b9f\u884c\u6761\u4ef6\u304c\u3042\u308a\u307e\u3059\u3002 <\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:shortcode -->\n<div class=\"box_border_gray\">\n<h5>\u53c2\u7167\u30ab\u30a6\u30f3\u30bf\u65b9\u5f0f<\/h5>\n<p>\n\u30fb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3054\u3068\u306b\u53c2\u7167\u30ab\u30a6\u30f3\u30bf\u304c\u4fdd\u6301\u3055\u308c\u3001\u53c2\u7167\u56de\u6570\u304c\u5c11\u306a\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30e1\u30e2\u30ea\u3092\u3001\u81ea\u52d5\u7684\u306b\u89e3\u653e\u3059\u308b<br>\n\u30fb\u5faa\u74b0\u53c2\u7167\uff08\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u9593\u3067\u76f8\u4e92\u306b\u53c2\u7167\u304c\u3042\u308a\u3001\u305d\u306e\u7d50\u679c\u53c2\u7167\u30ab\u30a6\u30f3\u30bf\u304c\u30bc\u30ed\u306b\u306a\u3089\u306a\u3044\u72b6\u6cc1\uff09\u306b\u5bfe\u5fdc\u3067\u304d\u306a\u3044<br>\u3000\u4f8b\uff1aa=a+1\n<\/p>\n<h5>\u4e16\u4ee3\u5225\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3<\/h5>\n<p>\n\u30fb\u30e1\u30e2\u30ea\u306e\u7ba1\u7406\u3092\u52b9\u7387\u5316\u3059\u308b\u305f\u3081\u306b\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u4e16\u4ee3\u306b\u5206\u3051\u3089\u308c\u6700\u521d\u306e\u4e16\u4ee3\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u983b\u7e41\u306b\u53ce\u96c6\u3055\u308c\u308b<br>\n\u30fb\u53c2\u7167\u30ab\u30a6\u30f3\u30bf\u3067\u62fe\u3044\u304d\u308c\u306a\u3044\u90e8\u5206\u3092\u88dc\u3046\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u308b\n<\/p>\n<\/div>\n<!-- \/wp:shortcode -->\n\n<!-- wp:html -->\n<div id=\"cont1-2\" class=\"anchor\"><\/div>\n<!-- \/wp:html -->\n\n<!-- wp:heading {\"level\":4,\"className\":\"underline\"} -->\n<h4 class=\"underline\">\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u8d77\u304d\u3084\u3059\u3044\u4f8b<\/h4>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>\u3067\u306f\u3001Python\u30a2\u30d7\u30ea\u958b\u767a\u3067\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u8d77\u304d\u3084\u3059\u3044\u306e\u306f\u3001\u3069\u306e\u3088\u3046\u306a\u5834\u5408\u3067\u3057\u3087\u3046\u304b\u3002 \u8abf\u3079\u3066\u307f\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u72b6\u6cc1\u306e\u6642\u306b\u7279\u306b\u8d77\u304d\u3084\u3059\u3044\u3088\u3046\u3067\u3059\u3002 <\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:shortcode -->\n<div class=\"box_border_gray\">\n<h5>\u4e0d\u8981\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u524a\u9664\u6f0f\u308c<\/h5>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u4e0d\u8981\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3084\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3078\u306e\u53c2\u7167\u3092\u4fdd\u6301\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u305d\u308c\u3089\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u30e1\u30e2\u30ea\u5185\u306b\u6b8b\u308a\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306e\u539f\u56e0\u3068\u306a\u308b\u3002<\/p>\n<h5>\u5faa\u74b0\u53c2\u7167<\/h5>\n<p>Python\u3067\u306f\u5faa\u74b0\u53c2\u7167\u304c\u8d77\u3053\u308a\u3084\u3059\u304f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8A\u3068\u30aa\u30d6\u30b8\u30a7\u30af\u30c8B\u304c\u304a\u4e92\u3044\u306b\u53c2\u7167\u3057\u5408\u3046\u3068\u53c2\u7167\u3092\u89e3\u653e\u3067\u304d\u305a\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u767a\u751f\u3059\u308b\u3002<\/p>\n<h5>\u8f9e\u66f8\u578b\u306e\u4f7f\u7528<\/h5>\n<p>\u8f9e\u66f8\u578b\uff08dict\uff09\u306f\u53ef\u5909\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3042\u308a\u3001\u5927\u304d\u306a\u8f9e\u66f8\u3092\u4e0d\u8981\u306a\u307e\u307e\u4fdd\u6301\u3057\u3066\u304a\u304f\u3068\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u751f\u3058\u308b\u3002<br>\n\u95a2\u6570\u306e\u30ea\u30bf\u30fc\u30f3\u304c\u8f9e\u66f8\u578b\u3067\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u751f\u3058\u308b\u306e\u3067\u3001yield\u3092\u4f7f\u7528\u3057\u30661\u884c\u3054\u3068\u51fa\u529b\u3059\u308b\u7b49\u5024\u3092\u8fd4\u3059\u3002\n<\/p>\n<\/div>\n<!-- \/wp:shortcode -->\n\n<!-- wp:paragraph -->\n<p>\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u767a\u751f\u3057\u3066\u3057\u307e\u3063\u305f\u5834\u5408\u3001\u3069\u306e\u3088\u3046\u306b\u539f\u56e0\u3092\u7279\u5b9a\u3057\u3066\u3044\u304f\u306e\u304b\u3002<br>\n\u554f\u984c\u89e3\u6c7a\u306e\u305f\u3081\u306e\u4fbf\u5229\u306a\u30c4\u30fc\u30eb\u3092\u3054\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:html -->\n<div id=\"cont2\" class=\"anchor\">&nbsp;<\/div>\n<!-- \/wp:html -->\n\n<!-- wp:heading {\"className\":\"title\"} -->\n<h2 class=\"title\">\u30e1\u30e2\u30ea\u5360\u6709\u7387\u306e\u6e2c\u5b9a - memory_profiler<\/h2>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>\u307e\u305a\u306f\u30e1\u30e2\u30ea\u30d7\u30ed\u30d5\u30a1\u30a4\u30ea\u30f3\u30b0\u30c4\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u3066\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u3069\u306e\u90e8\u5206\u3067\u30e1\u30e2\u30ea\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u6e2c\u5b9a\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306e\u767a\u751f\u6e90\u3092\u7279\u5b9a\u3067\u304d\u307e\u3059\u3002<br>\u4eca\u56de\u4f7f\u7528\u3057\u305f\u306e\u306f\u3001Python\u306e\u30e1\u30e2\u30ea\u30d7\u30ed\u30d5\u30a1\u30a4\u30ea\u30f3\u30b0\u30c4\u30fc\u30eb\u300cmemory_profiler\u300d\u3067\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:heading {\"level\":4} -->\n<h4>\u4e8b\u524d\u6e96\u5099<\/h4>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>memory_profiler\u3068psutil\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u3001pip\u3092\u4f7f\u7528\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph {\"backgroundColor\":\"black\",\"textColor\":\"white\"} -->\n<p class=\"has-white-color has-black-background-color has-text-color has-background\"><code># memory_profiler\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/code><br><code>$ pip install -U memory_profiler<\/code><br><br><code># psutil\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/code><br><code>$ pip install psutil<\/code><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:heading {\"level\":4} -->\n<h4>\u958b\u767a\u74b0\u5883\u3078\u306e\u5b9f\u88c5<\/h4>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb(test.sh)\u5185\u306ehandle.py\u306e\u5b9f\u884c\u90e8\u5206\u3092\u4ee5\u4e0b\u306b\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<br>(memory_profile\u306b\u3088\u308b\u8ffd\u52a0\u306f\"-m memory_profiler\")<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph {\"backgroundColor\":\"black\",\"textColor\":\"white\"} -->\n<p class=\"has-white-color has-black-background-color has-text-color has-background\"><code>python3 -B -m memory_profiler&nbsp; .\/handler.py $test_root<\/code><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>\"-o &lt;\u51fa\u529b\u3057\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u540d&gt;.log\"\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u8a2d\u5b9a\u306b\u3088\u308a\u3001\u5b9f\u884c\u74b0\u5883\u306epython\u4ee5\u4e0b\u306b\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u306elog\u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>\u8a08\u6e2c\u3057\u305f\u3044\u95a2\u6570\u306e\u5b9a\u7fa9\u4f4d\u7f6e\u306b\u3066\u3001\u30c7\u30b3\u30ec\u30fc\u30bf(@profile)\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph {\"backgroundColor\":\"cyan-bluish-gray\",\"textColor\":\"black\"} -->\n<p class=\"has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\"><code>@profile<\/code><br><code>def&lt;\u8a08\u6e2c\u5bfe\u8c61\u306e\u95a2\u6570&gt;:<\/code><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:gallery {\"ids\":[12627],\"linkTo\":\"none\",\"sizeSlug\":\"full\"} -->\n<figure class=\"wp-block-gallery columns-1 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img src=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/10\/d851c1ac29c337298a6d72f608fd9940.png\" alt=\"\" data-id=\"12627\" data-full-url=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/10\/d851c1ac29c337298a6d72f608fd9940.png\" data-link=\"https:\/\/hldc.co.jp\/blog\/memory_profiler_%e5%ae%9f%e8%a3%85\/\" class=\"wp-image-12627\"\/><\/figure><\/li><\/ul><\/figure>\n<!-- \/wp:gallery -->\n\n<!-- wp:heading {\"level\":4} -->\n<h4>\u5b9f\u884c\u7d50\u679c<\/h4>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u4e0b\u56f3\u306e\u901a\u308a\u3001\u30e1\u30e2\u30ea\u5360\u6709\u7387\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:gallery {\"ids\":[12628],\"linkTo\":\"none\",\"sizeSlug\":\"full\"} -->\n<figure class=\"wp-block-gallery columns-1 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img src=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/10\/65c0727ef2eb5e10faf482375cb7269c.png\" alt=\"\" data-id=\"12628\" data-full-url=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/10\/65c0727ef2eb5e10faf482375cb7269c.png\" data-link=\"https:\/\/hldc.co.jp\/blog\/memory_profiler_%e5%ae%9f%e8%a1%8c%e7%b5%90%e6%9e%9c\/\" class=\"wp-image-12628\"\/><\/figure><\/li><\/ul><\/figure>\n<!-- \/wp:gallery -->\n\n<!-- wp:heading {\"level\":4} -->\n<h4>memory_profiler\u3067\u306e\u6e2c\u5b9a\u306e\u3001\u30e1\u30ea\u30c3\u30c8\u3068\u30c7\u30e1\u30ea\u30c3\u30c8<\/h4>\n<!-- \/wp:heading -->\n\n<!-- wp:shortcode -->\n<div class=\"box_border_gray\">\n<h5>\u30e1\u30ea\u30c3\u30c8<\/h5>\n<p>\u8abf\u67fb\u7bc4\u56f2\u304c\u5e83\u3044\u6642\u306b\u6709\u52b9\u3002\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5909\u66f4\u91cf\u304c\u5c11\u306a\u3044\u3002<\/p>\n<h5>\u30c7\u30e1\u30ea\u30c3\u30c8<\/h5>\n<p>\u7e70\u308a\u8fd4\u3057\u547c\u3073\u51fa\u3055\u308c\u308b\u3068\u6e2c\u5b9a\u7b87\u6240\u304c\u4e0d\u660e\u77ad\u306b\u306a\u308b\u3002\u51e6\u7406\u901f\u5ea6\u304c\u9045\u304f\u306a\u308b\u3002<\/p>\n<\/div>\n<!-- \/wp:shortcode -->\n\n<!-- wp:heading {\"level\":4} -->\n<h4>\u6642\u7cfb\u5217\u306e\u30b0\u30e9\u30d5\u306e\u51fa\u529b<\/h4>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>matplotlib\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3042\u308c\u3070<br>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6642\u7cfb\u5217\u306e\u30b0\u30e9\u30d5\u3092\u51fa\u529b\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph {\"backgroundColor\":\"cyan-bluish-gray\",\"textColor\":\"black\"} -->\n<p class=\"has-black-color has-cyan-bluish-gray-background-color has-text-color has-background\">\u3000\u2022mprof&nbsp; run &lt;\u30b9\u30af\u30ea\u30d7\u30c8&gt;<br>\u3000\u2022mprof plot<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:image {\"id\":12535,\"sizeSlug\":\"full\",\"linkDestination\":\"none\"} -->\n<figure class=\"wp-block-image size-full\"><img src=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/09\/10-3.png\" alt=\"\" class=\"wp-image-12535\"\/><\/figure>\n<!-- \/wp:image -->\n\n<!-- wp:html -->\n<div id=\"cont3\" class=\"anchor\">&nbsp;<\/div>\n<!-- \/wp:html -->\n\n<!-- wp:heading {\"className\":\"title\"} -->\n<h2 class=\"title\">\u4eee\u60f3\u30e1\u30e2\u30ea\u60c5\u5831\u306e\u53d6\u5f97 - virtual_memory()<\/h2>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>virtual_memory()\u95a2\u6570\u306f\u3001Python\u306epsutil\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u95a2\u6570\u306e\u4e00\u3064\u3067\u3059\u3002<br>Bash\u306efree\u30b3\u30de\u30f3\u30c9\u3068\u540c\u69d8\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u4eee\u60f3\u30e1\u30e2\u30ea\u306e\u5408\u8a08\u30b5\u30a4\u30ba\u3001\u4f7f\u7528\u91cf\u3001\u7a7a\u304d\u5bb9\u91cf\u3001\u4eee\u60f3\u30e1\u30e2\u30ea\u306e\u30da\u30fc\u30b8\u30f3\u30b0\u7d71\u8a08\u306a\u3069\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3067\u304d\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u30b7\u30b9\u30c6\u30e0\u306e\u30e1\u30e2\u30ea\u30ea\u30bd\u30fc\u30b9\u3092\u52b9\u679c\u7684\u306b\u5229\u7528\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:heading {\"level\":4} -->\n<h4>\u4f7f\u7528\u65b9\u6cd5<\/h4>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>\u52d5\u4f5c\u74b0\u5883\u306b\u3001psutil\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br>\u4f7f\u7528\u3057\u305f\u3044\u30b9\u30af\u30ea\u30d7\u30c8\u306bpsutil\u3092import\u3057\u3066\u3001\u78ba\u8a8d\u3057\u305f\u3044\u7b87\u6240\u3067psutil.virtual_memory()\u3092\u547c\u3073\u51fa\u3057\u3001\u30ed\u30b0\u306b\u51fa\u529b\u3057\u307e\u3059\u3002<br>\u5f15\u6570\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u4f7f\u7528\u91cf\u3001\u7a7a\u304d\u5bb9\u91cf\u7b49\u306e\u6307\u5b9a\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:image {\"id\":12660,\"sizeSlug\":\"full\",\"linkDestination\":\"none\"} -->\n<figure class=\"wp-block-image size-full\"><img src=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/10\/cd51e9a97c0c31a3588e4b68ccb0a1f4-1.png\" alt=\"\" class=\"wp-image-12660\"\/><\/figure>\n<!-- \/wp:image -->\n\n<!-- wp:heading {\"level\":4} -->\n<h4>\u5b9f\u884c\u7d50\u679c<\/h4>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>\u4e0b\u56f3\u306e\u901a\u308a\u3001\u30e1\u30e2\u30ea\u306e\u4f7f\u7528\u91cf\u7b49\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:image {\"id\":12632,\"sizeSlug\":\"full\",\"linkDestination\":\"none\"} -->\n<figure class=\"wp-block-image size-full\"><img src=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/10\/769e1c340049377a0130e35516bd945f.png\" alt=\"\" class=\"wp-image-12632\"\/><\/figure>\n<!-- \/wp:image -->\n\n<!-- wp:heading {\"level\":4} -->\n<h4>virtual_memory()\u3067\u306e\u6e2c\u5b9a\u306e\u3001\u30e1\u30ea\u30c3\u30c8\u3068\u30c7\u30e1\u30ea\u30c3\u30c8 <\/h4>\n<!-- \/wp:heading -->\n\n<!-- wp:shortcode -->\n<div class=\"box_border_gray\">\n<h5>\u30e1\u30ea\u30c3\u30c8<\/h5>\n<p>\u7e70\u308a\u8fd4\u3057\u547c\u3076\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u3082\u6709\u52b9\u3002\u51e6\u7406\u3082\u8efd\u3044\u3002<\/p>\n<h5>\u30c7\u30e1\u30ea\u30c3\u30c8<\/h5>\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5909\u66f4\u91cf\u304c\u5897\u3048\u308b\u3002\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u81ea\u4f53\u306e\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u304c\u4e0d\u660e\u77ad\u3002<\/p>\n<\/div>\n<!-- \/wp:shortcode -->\n\n<!-- wp:html -->\n<div id=\"cont4\" class=\"anchor\">&nbsp;<\/div>\n<!-- \/wp:html -->\n\n<!-- wp:heading {\"className\":\"title\"} -->\n<h2 class=\"title\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30b5\u30a4\u30ba\u306e\u6e2c\u5b9a - __size_of_()\u3001getsizeof()<\/h2>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>__size_of_()\u3084getsizeof()\u95a2\u6570\u3092\u7528\u3044\u308b\u3068\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30b5\u30a4\u30ba\u3092\u8abf\u3079\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306e\u500b\u5225\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u7279\u5b9a\u3059\u308b\u306e\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u53d6\u5f97\u3055\u308c\u308b\u30b5\u30a4\u30ba\u306e\u5358\u4f4d\u306f\u30d0\u30a4\u30c8\u306b\u306a\u308a\u307e\u3059\u3002<br><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>getsizeof()\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001sys\u3092import\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:image {\"id\":12633,\"sizeSlug\":\"full\",\"linkDestination\":\"none\"} -->\n<figure class=\"wp-block-image size-full\"><img src=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/10\/8e78994466ee831639fee501524e492c.png\" alt=\"\" class=\"wp-image-12633\"\/><\/figure>\n<!-- \/wp:image -->\n\n<!-- wp:heading {\"level\":4} -->\n<h4>\u5b9f\u884c\u7d50\u679c<\/h4>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p> \u4e0b\u56f3\u306e\u901a\u308a\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30b5\u30a4\u30ba\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 <\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:image {\"id\":12634,\"sizeSlug\":\"full\",\"linkDestination\":\"none\"} -->\n<figure class=\"wp-block-image size-full\"><img src=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/10\/39b652f9e74a2f18cd43bbb04f90d9e5.png\" alt=\"\" class=\"wp-image-12634\"\/><\/figure>\n<!-- \/wp:image -->\n\n<!-- wp:html -->\n<div id=\"cont5\" class=\"anchor\">&nbsp;<\/div>\n<!-- \/wp:html -->\n\n<!-- wp:heading {\"className\":\"title\"} -->\n<h2 class=\"title\">\u307e\u3068\u3081<\/h2>\n<!-- \/wp:heading -->\n\n<!-- wp:paragraph -->\n<p>\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<br>Python\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u4e0a\u3067\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306f\u9762\u5012\u306a\u554f\u984c\u3067\u3059\u3002<br>\u3067\u3082\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5b89\u5b9a\u6027\u3068\u6027\u80fd\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u53ca\u307c\u3059\u554f\u984c\u3067\u3059\u306e\u3067\u3001<br>\u4eca\u56de\u3054\u7d39\u4ecb\u3057\u305f\u624b\u6cd5\u306a\u3069\u3092\u4f7f\u3063\u3066\u3001\u65e9\u3081\u306b\u539f\u56e0\u306e\u7279\u5b9a\u3092\u884c\u3063\u3066\u554f\u984c\u3092\u89e3\u6c7a\u3057\u3066\u3044\u304d\u305f\u3044\u3067\u3059\u306d\uff01<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p><\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:shortcode -->\n<div class=\"box_border_gray\">\n<h3 id=\"seminar_title\">\u30cf\u30fc\u30c8\u30e9\u30f3\u30c9\u30fb\u30c7\u30fc\u30bf\u3068\u3044\u3048\u3070\u52d5\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3010DT+\u3011<\/h3>\n[one_half]\n<img class=\"alignnone size-full\" src=\"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2021\/12\/df98a638b295348fdd6e42fb4e05853e.png\" alt=\"\" width=\"500\" height=\"375\">\n[\/one_half]\n\n[one_half_last]\n\u5b9f\u6a5f\u3092\u52d5\u304b\u3057\u3066\u3001\u300c\u30ca\u30de\u306e\u6319\u52d5\u300d\u3092\u89e3\u6790\u3059\u308b\u52d5\u7684\u89e3\u6790\u3002\n\u30bd\u30d5\u30c8\u306e\u5b9f\u884c\u7d4c\u8def\u3084\u5b9f\u884c\u6642\u9593\u304b\u3089\u3001\u30cf\u30fc\u30c9\u5074\u306e\u6319\u52d5\u307e\u3067\uff01\u5168\u90e8\u3072\u3068\u624b\u9593\u3067\u89e3\u6790\u3067\u304d\u307e\u3059\u3002\n<p style=\"padding-top: 15px;\">\n[galink class=\"button button-blue\" target=\"_blank\" rel=\"noopener\" href=\"https:\/\/hldc.co.jp\/product_service\/development\/dtplus\/dtplus-trace\/\" onclick=\"gtag('event', 'Click', {'event_category': 'WebLink','event_label': 'toDTplus\u88fd\u54c1\u30da\u30fc\u30b8_from12518});\" ]DT+\u306e\u8a73\u7d30\u306f\u3053\u3061\u3089[\/galink]\n<\/p>\n[\/one_half_last]\n<\/div>\n<!-- \/wp:shortcode -->","_et_gb_content_width":"","_links_to":"","_links_to_target":""},"categories":[66,2],"tags":[48,51,65],"featured_image_src":"https:\/\/hldc.co.jp\/blog\/wp-content\/uploads\/2023\/10\/Python_MemoryAnalysis_TOP-400x250.png","post_categories":[{"term_id":66,"name":"Python","link":"https:\/\/hldc.co.jp\/blog\/category\/technical\/python\/"},{"term_id":2,"name":"\u6280\u8853\u60c5\u5831","link":"https:\/\/hldc.co.jp\/blog\/category\/technical\/"}],"_links":{"self":[{"href":"https:\/\/hldc.co.jp\/blog\/wp-json\/wp\/v2\/posts\/12518"}],"collection":[{"href":"https:\/\/hldc.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hldc.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hldc.co.jp\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/hldc.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=12518"}],"version-history":[{"count":95,"href":"https:\/\/hldc.co.jp\/blog\/wp-json\/wp\/v2\/posts\/12518\/revisions"}],"predecessor-version":[{"id":14614,"href":"https:\/\/hldc.co.jp\/blog\/wp-json\/wp\/v2\/posts\/12518\/revisions\/14614"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hldc.co.jp\/blog\/wp-json\/wp\/v2\/media\/12657"}],"wp:attachment":[{"href":"https:\/\/hldc.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=12518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hldc.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=12518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hldc.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=12518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}