{"id":8401,"date":"2020-07-22T20:41:31","date_gmt":"2020-07-22T12:41:31","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=8401"},"modified":"2020-07-22T21:33:08","modified_gmt":"2020-07-22T13:33:08","slug":"chmem","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/chmem","title":{"rendered":"chmem\u547d\u4ee4 – \u8bbe\u7f6e\u5185\u5b58"},"content":{"rendered":"\n

chmem\u547d\u4ee4\u5c06\u7279\u5b9a\u5927\u5c0f\u6216\u8303\u56f4\u7684\u5185\u5b58\u8bbe\u7f6e\u4e3a\u8054\u673a\u6216\u79bb\u7ebf\u3002\u5f53\u8bbe\u7f6e\u5185\u5b58\u8054\u673a\u65f6\uff0cchmem\u4ece\u6700\u4f4e\u5185\u5b58\u5757\u5f00\u59cb\u6570\u5b57\u3002\u5f53\u8bbe\u7f6e\u5185\u5b58\u8131\u673a\u65f6\uff0cchmem\u4ece\u6700\u9ad8\u5185\u5b58\u5757\u7f16\u53f7<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>chmem [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-b, --blocks<\/td>\u4e3aenable\u548c--disable\u9009\u9879\u4f7f\u7528blockrange\u53c2\u6570\uff0c\u800c\u4e0d\u662frange\u6216size<\/td><\/tr>
-d, --disable<\/td>\u8bbe\u7f6e\u5185\u5b58\u7684\u6307\u5b9a\u8303\u56f4\u3001\u5927\u5c0f\u6216\u5757\u8303\u56f4
\u4e3a\u79bb\u7ebf<\/td><\/tr>
-e, --enable<\/td>\u5c06\u6307\u5b9a\u7684\u5185\u5b58\u8303\u56f4\u3001\u5927\u5c0f\u6216\u5757\u8303\u56f4\u8bbe\u7f6e\u4e3a\u8054\u673a<\/td><\/tr>
-z, --zone<\/td>\u9009\u62e9\u8981\u5728\u5176\u4e2d\u8bbe\u7f6e\u6307\u5b9a\u8303\u56f4\u3001\u5927\u5c0f\u548c
\u6216\u5728\u7ebf\u6216\u79bb\u7ebf\u7684\u5185\u5b58\u5757\u8303\u56f4\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5185\u5b58\u5c06\u8bbe\u7f6e\u4e3a\u53ef\u79fb\u52a8\u7684\u5728\u7ebf\u533a\u57df<\/td><\/tr>
-h, --help<\/td>\u5e2e\u52a9\u4fe1\u606f<\/td><\/tr>
-v, --verbose<\/td>\u8f93\u51fa\u8be6\u7ec6\u4fe1\u606f<\/td><\/tr>
-V, --version<\/td>\u7248\u672c\u4fe1\u606f<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u5c061024 Mb\u7684\u5185\u5b58\u8bbe\u7f6e\u4e3a\u8054\u673a\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# chmem --enable 1024<\/pre>\n\n\n\n

\u5c062 Gb\u5185\u5b58\u8bbe\u7f6e\u4e3a\u8054\u673a\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# chmem -e 2g<\/pre>\n\n\n\n

\u4ece\u5f00\u59cb\u7684\u5185\u5b58\u8303\u56f40x00000000e40000\uff0c\u4ee50x00000000f3ffffffff\u7ed3\u5c3e
\u8bbe\u7f6e\u4e3a\u8131\u673a\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# chmem --disable 0x00000000e4000000-0x00000000f3ffffff<\/pre>\n\n\n\n

\u8bbe\u7f6e\u7f16\u53f710\u7684\u5b58\u50a8\u5668\u5757\u79bb\u7ebf\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# chmem -b -d 10<\/pre>\n","protected":false},"excerpt":{"rendered":"

chmem\u547d\u4ee4\u5c06\u7279\u5b9a\u5927\u5c0f\u6216\u8303\u56f4\u7684\u5185\u5b58\u8bbe\u7f6e\u4e3a\u8054\u673a\u6216\u79bb\u7ebf\u3002\u5f53\u8bbe\u7f6e\u5185\u5b58\u8054\u673a\u65f6\uff0cchmem\u4ece\u6700\u4f4e\u5185\u5b58\u5757\u5f00\u59cb\u6570\u5b57\u3002\u5f53\u8bbe\u7f6e […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8401"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=8401"}],"version-history":[{"count":2,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8401\/revisions"}],"predecessor-version":[{"id":8407,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8401\/revisions\/8407"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=8401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=8401"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=8401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}