{"id":312,"date":"2012-07-09T16:52:44","date_gmt":"2012-07-09T07:52:44","guid":{"rendered":"http:\/\/soundengine.jp\/wordpress\/tips\/?p=312"},"modified":"2014-02-06T23:42:37","modified_gmt":"2014-02-06T14:42:37","slug":"vc-getsetprocessworkingsetsize%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9","status":"publish","type":"post","link":"https:\/\/soundengine.jp\/wordpress\/tips\/tutorial\/312\/","title":{"rendered":"VC++ Get&amp;SetProcessWorkingSetSize\u306e\u4f7f\u3044\u65b9"},"content":{"rendered":"<h2 id=\"content_1_0\">\u30ef\u30fc\u30ad\u30f3\u30b0\u30bb\u30c3\u30c8  <a class=\"anchor_super\" id=\"xb3fe18e\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-05-19#xb3fe18e\" title=\"xb3fe18e\"> <\/a><\/h2>\n<p>\u5404\u30d7\u30ed\u30bb\u30b9\u306b\u306f\u30ef\u30fc\u30ad\u30f3\u30b0\u30bb\u30c3\u30c8\u3068\u3044\u3046\u3082\u306e\u304c\u5b58\u5728\u3057\u3001\u3053\u306e\u30b5\u30a4\u30ba\u306f\u5e38\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u3066\u3044\u308b\u7269\u7406\u30e1\u30e2\u30ea\u91cf\u3092\u610f\u5473\u3059\u308b\u3002Windows\u306e\u5834\u5408\u3053\u306e\u30ef\u30fc\u30ad\u30f3\u30b0\u30bb\u30c3\u30c8\u306e\u30b5\u30a4\u30ba\u306f\u3001\u6700\u5c0f\u5024\u3068\u6700\u5927\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u53ef\u80fd\u306a\u9650\u308a\u305d\u306e\u7bc4\u56f2\u5185\u306e\u30b5\u30a4\u30ba\u3067\u7269\u7406\u30e1\u30e2\u30ea\u3092\u5272\u308a\u5f53\u3066\u308b\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u306a\u304a\u3001\u73fe\u5728\u5272\u308a\u5f53\u3066\u3089\u308c\u3066\u3044\u308b\u7269\u7406\u30e1\u30e2\u30ea\u91cf\u3092\u77e5\u308b\u306b\u306f\u3001\u30bf\u30b9\u30af\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u306e\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u3068\u3044\u3046\u90e8\u5206\u3092\u898b\u308b\u3068\u3088\u3044\u3002<\/p>\n<div class=\"img_margin\" style=\"text-align: left\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/soundengine.jp\/backend\/?plugin=ref&amp;page=services%2Ftips%2F2007-05-19&amp;src=task_manager.gif\" alt=\"task_manager.gif\" height=\"265\" width=\"311\"><\/div>\n<div class=\"spacer\">&nbsp;<\/div>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_1\">GetProcessWorkingSetSize  <a class=\"anchor_super\" id=\"q7904c6d\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-05-19#q7904c6d\" title=\"q7904c6d\"> <\/a><\/h2>\n<p>\u3053\u306e\u95a2\u6570\u3067\u3001\u3042\u308b\u30d7\u30ed\u30bb\u30b9\u306e\u30ef\u30fc\u30ad\u30f3\u30b0\u30bb\u30c3\u30c8\u306e\u30b5\u30a4\u30ba\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u81ea\u5206\u306e\u30d7\u30ed\u30bb\u30b9\u306e\u30ef\u30fc\u30ad\u30f3\u30b0\u30bb\u30c3\u30c8\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u6b21\u306e\u3088\u3046\u306b\u884c\u3046\u3002<\/p>\n<pre>const DWORD pid = GetCurrentProcessId();\r\n\r\nHANDLE hp = OpenProcess\r\n\t(\r\n\tPROCESS_ALL_ACCESS,\r\n\tTRUE,\r\n\tpid\r\n\t);\r\n\r\nDWORD min;\r\nDWORD max;\r\n\r\nGetProcessWorkingSetSize\r\n\t(\r\n\thp,\r\n\t&amp;min,\r\n\t&amp;max\r\n\t);<\/pre>\n<p>\u306a\u304a\u3001\u30d7\u30ed\u30bb\u30b9\u30cf\u30f3\u30c9\u30eb\u3092\u53d6\u5f97\u3059\u308b\u6642\u306bPROCESS_ALL_ACCESS\u3068\u3044\u3046\u30a2\u30af\u30bb\u30b9\u6a29\u9650\u3092\u5272\u308a\u5f53\u3066\u3066\u3044\u308b\u304c\u3001\u3053\u308c\u306f<a href=\"http:\/\/msdn.microsoft.com\/library\/ja\/default.asp?url=\/library\/ja\/jpdllpro\/html\/_win32_getprocessworkingsetsize.asp\" rel=\"nofollow\">MSDN\u3092\u53c2\u7167<\/a>\u3059\u308b\u3068GetProcessWorkingSetSize\u3092\u4f7f\u3046\u305f\u3081\u306e\u30d7\u30ed\u30bb\u30b9\u30cf\u30f3\u30c9\u30eb\u306b\u306f\u3001<\/p>\n<blockquote>\n<p class=\"quotation\">PROCESS_QUERY_INFORMATION \u30a2\u30af\u30bb\u30b9\u6a29\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<\/blockquote>\n<p>\u3068\u3044\u3046\u3053\u3068\u304b\u3089\u3067\u3042\u308b\u3002\u5358\u7d14\u306a\u30b3\u30f3\u30bd\u30fc\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u8a66\u3057\u305f\u3068\u3053\u308d\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u6700\u5c0f200KB\u6700\u59271380KB\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3060\u3002<\/p>\n<div class=\"jumpmenu\">\n<\/div>\n<h2 id=\"content_1_2\">SetProcessWorkingSetSize  <a class=\"anchor_super\" id=\"xdd8ab26\" href=\"http:\/\/soundengine.jp\/backend\/?services%2Ftips%2F2007-05-19#xdd8ab26\" title=\"xdd8ab26\"> <\/a><\/h2>\n<p>\u3053\u306e\u95a2\u6570\u3067\u3001\u3042\u308b\u30d7\u30ed\u30bb\u30b9\u306e\u30ef\u30fc\u30ad\u30f3\u30b0\u30bb\u30c3\u30c8\u306e\u30b5\u30a4\u30ba\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u81ea\u5206\u306e\u30d7\u30ed\u30bb\u30b9\u306e\u30ef\u30fc\u30ad\u30f3\u30b0\u30bb\u30c3\u30c8\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u6b21\u306e\u3088\u3046\u306b\u884c\u3046\u3002<\/p>\n<pre>const DWORD pid = GetCurrentProcessId();\r\n\r\nHANDLE hp = OpenProcess\r\n\t(\r\n\tPROCESS_ALL_ACCESS,\r\n\tTRUE,\r\n\tpid\r\n\t);\r\n\r\nSetProcessWorkingSetSize\r\n\t(\r\n\thp,\r\n\t1024 * 1024 * 1,\r\n\t1024 * 1024 * 10\r\n\t);<\/pre>\n<p>\u306a\u304a\u3001\u30d7\u30ed\u30bb\u30b9\u30cf\u30f3\u30c9\u30eb\u3092\u53d6\u5f97\u3059\u308b\u6642\u306bPROCESS_ALL_ACCESS\u3068\u3044\u3046\u30a2\u30af\u30bb\u30b9\u6a29\u9650\u3092\u5272\u308a\u5f53\u3066\u3066\u3044\u308b\u304c\u3001\u3053\u308c\u306f<a href=\"http:\/\/msdn.microsoft.com\/library\/ja\/default.asp?url=\/library\/ja\/jpdllpro\/html\/_win32_setprocessworkingsetsize.asp\" rel=\"nofollow\">MSDN\u3092\u53c2\u7167<\/a>\u3059\u308b\u3068SetProcessWorkingSetSize\u3092\u4f7f\u3046\u305f\u3081\u306e\u30d7\u30ed\u30bb\u30b9\u30cf\u30f3\u30c9\u30eb\u306b\u306f\u3001<\/p>\n<blockquote>\n<p class=\"quotation\">PROCESS_SET_QUOTA \u30a2\u30af\u30bb\u30b9\u6a29\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<\/blockquote>\n<p>\u3068\u3044\u3046\u3053\u3068\u304b\u3089\u3067\u3042\u308b\u3002\u307e\u305f\u3001<\/p>\n<blockquote>\n<p class=\"quotation\">dwMinimumWorkingSetSize \u3068 dwMaximumWorkingSetSize \u306e\u3069\u3061\u3089\u304b\u304c\u30d7\u30ed\u30bb\u30b9\u306e\u73fe\u5728\u306e\u30ef\u30fc\u30ad\u30f3\u30b0\u30bb\u30c3\u30c8\u30b5\u30a4\u30ba\u3092\u8d85\u3048\u308b\u5834\u5408\u306f\u3001\u6307\u5b9a\u3057\u305f\u30d7\u30ed\u30bb\u30b9\u306b<a href=\"http:\/\/soundengine.jp\/wordpress\/tips\/?p=314\">SE_INC_BASE_PRIORITY_NAME \u6a29<\/a>\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<\/blockquote>\n<p>\u3068\u3082\u66f8\u3044\u3066\u3042\u308b\u3002\u3053\u308c\u306b\u3064\u3044\u3066\u306f\u307e\u305f\u6b21\u56de\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30ef\u30fc\u30ad\u30f3\u30b0\u30bb\u30c3\u30c8 \u5404\u30d7\u30ed\u30bb\u30b9\u306b\u306f\u30ef\u30fc\u30ad\u30f3\u30b0\u30bb\u30c3\u30c8\u3068\u3044\u3046\u3082\u306e\u304c\u5b58\u5728\u3057\u3001\u3053\u306e\u30b5\u30a4\u30ba\u306f &hellip; <a href=\"https:\/\/soundengine.jp\/wordpress\/tips\/tutorial\/312\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-312","post","type-post","status-publish","format-standard","hentry","category-tutorial"],"_links":{"self":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/comments?post=312"}],"version-history":[{"count":4,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/312\/revisions"}],"predecessor-version":[{"id":3325,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/312\/revisions\/3325"}],"wp:attachment":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/media?parent=312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/categories?post=312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/tags?post=312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}