{"id":535370,"date":"2021-09-04T17:25:32","date_gmt":"2021-09-04T09:25:32","guid":{"rendered":"http:\/\/4563.org\/?p=535370"},"modified":"2021-09-04T17:25:32","modified_gmt":"2021-09-04T09:25:32","slug":"js-%e7%9a%84%e7%b1%bb%e6%9c%89%e6%b2%a1%e6%9c%89%e6%9e%90%e6%9e%84%e5%87%bd%e6%95%b0%ef%bc%8c%e5%a6%82%e4%bd%95%e8%bf%9b%e8%a1%8c%e8%b5%84%e6%ba%90%e9%87%8a%e6%94%be%ef%bc%9f%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=535370","title":{"rendered":"js \u7684\u7c7b\u6709\u6ca1\u6709\u6790\u6784\u51fd\u6570\uff0c\u5982\u4f55\u8fdb\u884c\u8d44\u6e90\u91ca\u653e\uff1f\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1> js \u7684\u7c7b\u6709\u6ca1\u6709\u6790\u6784\u51fd\u6570\uff0c\u5982\u4f55\u8fdb\u884c\u8d44\u6e90\u91ca\u653e\uff1f\uff1f <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : James369 <\/span>  <span><i><\/i> 7<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> \u67e5\u4e86\u534a\u5929\u6ca1\u770b\u5230 js \u7c7b\u6709\u6790\u6784\u51fd\u6570\uff0c\u90a3\u4e48\u7c7b\u5bf9\u8c61\u5728\u9500\u6bc1\u7684\u65f6\u5019\uff0c\u5982\u4f55\u628a\u7533\u8bf7\u7684\u8d44\u6e90\u91ca\u653e\u5462\uff0c\u5426\u5219\u53ef\u80fd\u5185\u5b58\u6cc4\u6f0f\u3002<br \/>\u6bd4\u5982\uff0c\u8003\u8651\u4ee5\u4e0b\u573a\u666f\uff0c\u6709\u4e00\u4e9b\u5b66\u751f\u7c7b Student\uff0c\u4ee5\u53ca\u4e00\u4e2a\u56fe\u4e66\u9986\u7c7b Library \u3002<br \/>1. \u5f00\u59cb\u521b\u5efa\u4e86\u82e5\u5e72\u5b66\u751f Student \u5bf9\u8c61\uff0c\u7136\u540e\u505a\u4e86\u4e00\u4e9b\u64cd\u4f5c\uff0c\u5411 Library \u501f\u4e86\u51e0\u672c\u4e66\u3002<br \/>2. \u8fc7\u4e86\u4e00\u4f1a\uff0c\u6709\u4e9b\u5b66\u751f\u5bf9\u8c61\u505a\u4e86\u4e00\u4e9b\u5176\u5b83\u64cd\u4f5c\uff08\u6bd4\u5982\u4e0a\u8bfe\u3001\u7761\u89c9\uff0c\u4f46\u5c31\u662f\u6ca1\u6709\u8fd8\u4e66\uff09\uff0c\u7136\u540e\u81ea\u52a8\u91ca\u653e\u4e86\uff08\u79bb\u5f00\u4e86\u53d8\u91cf\u4f5c\u7528\u57df\uff0c\u751f\u5b58\u5468\u671f\u7ed3\u675f\u4e86\uff09\u3002<br \/>3. \u6b64\u65f6\u867d\u7136\u8bf4 Student \u81ea\u52a8\u91ca\u653e\u4e86\uff0c\u4f46\u662f\u8fd8\u4e66\u64cd\u4f5c\u6ca1\u6709\u663e\u5f0f\u8c03\u7528\uff0c\u9020\u6210\u4e66\u7c4d\u672a\u8fd8\u3002<br \/>\u6240\u4ee5\uff0c\u5982\u679c Student \u7c7b\u6709\u6790\u6784\u51fd\u6570\uff0c\u6211\u5c31\u53ef\u4ee5\u5728\u6790\u6784\u51fd\u6570\u4e2d\u8fdb\u884c\u8fd8\u4e66\u7b49\u7684\u8d44\u6e90\u91ca\u653e\u3002\u6b63\u89c4\u8bed\u8a00\u90fd\u6709\u6790\u6784\u51fd\u6570\uff0c\u73b0\u5728\u600e\u4e48\u5904\u7406\uff0c\uff1f  <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>78<\/span>) <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"6699413\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : learningman <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u8fd9\u7c7b\u8bed\u8a00\u90fd\u4f1a\u81ea\u5df1 GC \u7684\uff0c\u653e\u5fc3\u5427\u3002\u5f15\u7528\u8ba1\u6570\u4e4b\u7c7b\u7684 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699414\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : James369 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @learningman \u81ea\u5df1\u4f1a\u91ca\u653e\u6ca1\u9519\uff0c\u4f46\u662f\u5b83\u64cd\u4f5c\u7684\u5176\u5b83\u8d44\u6e90\u4e0d\u4f1a\u81ea\u52a8\u8fdb\u884c\u53cd\u64cd\u4f5c\uff08\u8fd9\u4e0d\u662f\u5185\u5b58\u5f15\u7528\uff0c\u8fd9\u662f\u4e1a\u52a1\u64cd\u4f5c\uff09\u3002<br \/>\u6211\u518d\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u6bd4\u5982 Student \u5728 Canvas \u4e0a\u753b\u4e86\u4e00\u4e2a\u5706\uff0c\u4f46\u662f Student \u91ca\u653e\u7684\u65f6\u5019\uff0c\u5b83\u4e0d\u4f1a\u505a\u64e6\u9664\u5706\u7684\u64cd\u4f5c\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699415\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cxe2v <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u628a\u5bf9\u5e94\u7684\u8d44\u6e90\u53d8\u91cf\u7f6e\u7a7a\uff0c\u7b49\u5f15\u64ce GC \u7684\u65f6\u5019\u81ea\u5df1\u91ca\u653e <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699416\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yxwzaxns <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> v8 \u4f1a\u53bb\u505a\u8fd9\u4e9b\u4e8b\u60c5\uff0c\u8bb2\u9053\u7406\uff0c\u4e00\u4e2a\u6210\u719f\u7684\u8bed\u8a00\u5e94\u8be5\u4e0d\u7528\u8ba9\u4f7f\u7528\u8005\u53bb\u5173\u5fc3\u8fd9\u79cd\u95ee\u9898\uff0c\u4ed6\u5e94\u8be5\u4f1a\u81ea\u5df1\u5b66\u4f1a gc&#8230;\u5427 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699417\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : g1f9 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4ec0\u4e48\u53eb\u6b63\u89c4\u8bed\u8a00 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699418\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : NewConn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e0d\u77e5\u9053\u4e0a\u662f\u6ca1\u770b\u61c2\u4e3b\u95ee\u9898\uff0c\u8fd8\u662f\u4e0d\u77e5\u9053\u6790\u6784\u51fd\u6570\u662f\u4ec0\u4e48<br \/>\u4e3b\u663e\u7136\u95ee\u7684\u662f\u4e00\u4e2a\u4e1a\u52a1\u95ee\u9898\uff0c\u4e0d\u662f js \u6216\u8005 v8 \u7684 GC \u95ee\u9898<br \/>\u4e3b\u95ee\u7684\u662f\uff0c\u5bf9\u8c61\u9500\u6bc1\u65f6\uff0c\u4e1a\u52a1\u4e0a\u9700\u8981\u505a\u4e00\u4e2a\u4e1a\u52a1\u64cd\u4f5c\uff1b\u7c7b\u63a8\u5230\u6784\u9020\u51fd\u6570\u5c31\u662f\uff0c\u5bf9\u8c61\u521b\u5efa\u65f6\uff0c\u4e1a\u52a1\u4e0a\u505a\u4e00\u4e9b\u4e1a\u52a1\u64cd\u4f5c <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699419\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : akaxiaok339 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u6790\u6784\u51fd\u6570 Java \u6709\u5417<br \/>https:\/\/stackoverflow.com\/questions\/171952\/is-there-a-destructor-for-java <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699420\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : James369 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> #6 \u662f\u7684\uff0c\u5f88\u591a\u4eba\u8fd8\u662f\u6ca1\u660e\u767d\u6211\u7684\u610f\u601d\uff0c\u5509 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699421\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : gzf6 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u8bd5\u8bd5 WeakMap <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699422\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ahhui <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u6709\u7684\uff0c\u53c2\u8003\u8fd9\u91cc<br \/>https:\/\/stackoverflow.com\/questions\/22566667\/javascript-destructor-or-something-like-that<br \/>\u5f15\u7528\uff1a<br \/> this.destroy = function(){<br \/> this.stop();<br \/> } <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699423\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : misdake <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u6b63\u5e38\u4e0d\u5e94\u8be5\u4f9d\u8d56\u6790\u6784\u51fd\u6570\u6765\u505a\u8fd9\u4e9b\u4e8b\u60c5\u5427\u3002<br \/>\u501f\u4e66\u7684\u65f6\u5019 library \u5e94\u8be5\u8981\u8bb0\u5f55\u4e66\u501f\u7ed9\u8c01\u4e86\uff0c\u7559\u7740 student \u7684\u5f15\u7528\uff0cstudent \u4e0d\u4f1a\u88ab\u81ea\u52a8\u91ca\u653e\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699424\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : darknoll <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u662f gc \u8bed\u8a00 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699425\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pinkSlime <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u597d\u5bb6\u4f19\uff0cjavascript \u4e00\u4e0b\u88ab\u5f52\u7c7b\u4e3a\u4e0d\u6b63\u7ecf\uff0c\u4e0d\uff0c\u4e0d\u6b63\u89c4\u7684\u8bed\u8a00\u4e86<br \/>\u79c1\u4ee5\u4e3a \u6784\u6790\u51fd\u6570\u4ec5\u4ec5\u4e0e\u5185\u5b58\u76f8\u5173\uff0c\u5173\u95ed\u53e5\u67c4\u554a\u4e4b\u7c7b\u7684\u3002\u201c\u4e66\u201d\u8fd9\u4e2a\u5bf9\u8c61\u81ea\u6709 GC \u6765\u91ca\u653e\uff0c\u800c\u201c\u8fd8\u4e66\u201d\u8fd9\u660e\u660e\u662f\u4e2a\u903b\u8f91\u64cd\u4f5c\uff0c\u5e94\u8be5\u663e\u5f0f\u8c03\u7528\u66f4\u597d\u5427\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699426\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : darknoll <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u73b0\u5728\u9664\u4e86 c\/c++\uff0c\u57fa\u672c\u4e0a\u90fd\u662f gc \u8bed\u8a00 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699427\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : des <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e1a\u52a1\u5c42\u9762\u7684\u4e1c\u897f\u5c31\u8be5\u653e\u5728\u4e1a\u52a1\u5c42\u9762\u8003\u8651<br \/>\u201c \u6709\u4e9b\u5b66\u751f\u5bf9\u8c61\u505a\u4e86\u4e00\u4e9b\u5176\u5b83\u64cd\u4f5c\uff0c\u7136\u540e\u81ea\u52a8\u91ca\u653e\u4e86\u201d<br \/>\u4f60\u65e2\u7136\u77e5\u9053\u4ec0\u4e48\u65f6\u5019\u91ca\u653e\uff0c\u5c31\u8be5\u624b\u52a8\u5f52\u8fd8\u554a\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699428\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : microchang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u662f\u7c7b\u4f3c\u4e8e react \u91cc\u9762\u7684 componentwillunmount \u5427\uff1f\u8fd9\u4e2a\u4e0d\u77e5\u9053\u539f\u751f\u600e\u4e48\u5199\uff0c\u4e0d\u8fc7\u5e94\u8be5\u53ef\u4ee5\u5728\u4e1a\u52a1\u903b\u8f91\u4e0a\u7ed5\u5f00\u3002\u6216\u8005\u770b\u4e0a\u7684\u90a3\u4e2a <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699429\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Vegetable <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u6b63\u5e38\u6d89\u53ca\u5230\u4e1a\u52a1\u7684\u8d44\u6e90\u5e94\u8be5\u624b\u52a8\u91ca\u653e\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u5bf9\u8c61\u7684\u751f\u547d\u5468\u671f\u5427\u3002destructor \u8fd9\u79cd\u529f\u80fd\u5e94\u8be5\u5f88\u5c11\u7528\u5230\u624d\u5bf9\uff0c\u672c\u6765\u6709 GC \u673a\u5236\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u666e\u904d\u6ca1\u6709\u6790\u6784\u51fd\u6570\u4e00\u8bf4\u3002\u8fd9\u548c\u4e1a\u52a1\u5e94\u8be5\u662f\u4e24\u4e2a\u5c42\u9762\u7684\u4e1c\u897f\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699430\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pkoukk <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u6790\u6784\u51fd\u6570\u662f\u7528\u6765\u5e72\u8fd9\u4e2a\u7684\u4e48\uff1f<br \/>\u673a\u5668\u65ad\u7535\u91cd\u542f\uff0c\u6216\u8005\u8fdb\u7a0b\u88ab kill \u6389\u600e\u4e48\u529e\u554a\uff0c\u4f60\u8fd9\u4e9b\u6ca1\u8fd8\u4e66\u7684\u4e0d\u8fd8\u662f\u6ca1\u8fd8\u4e66\u561b&#8230;<br \/>\u4e1a\u52a1\u903b\u8f91\u5c31\u4e1a\u52a1\u5904\u7406..\u522b\u4f9d\u8d56\u8bed\u8a00\u673a\u5236 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699431\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wszgrcy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u8981\u4e0d\u7136\u8003\u8651\u9759\u6001\u4f9d\u8d56\u6ce8\u5165?\u5728\u9759\u6001\u4f9d\u8d56\u6ce8\u5165\u4e2d\u9500\u6bc1\u7684\u7c7b\u4f1a\u81ea\u52a8\u8c03\u7528\u9500\u6bc1\u51fd\u6570(\u524d\u63d0\u662f\u4f60\u8981\u5b9a\u4e49) <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699432\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : IsaacYoung <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e1a\u52a1\u8d44\u6e90\u7684\u91ca\u653e \u9700\u8981 \u4e1a\u52a1\u4ee3\u7801\u5904\u7406 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699433\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : janus77 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e1a\u52a1\u95ee\u9898\u5c31\u7528\u4e1a\u52a1\u529e\u6cd5\uff0c\u81ea\u5df1\u624b\u52a8\u91ca\u653e\u3002\u4f60\u8bf4\u7684\u201c\u79bb\u5f00\u4f5c\u7528\u57df\u4f1a\u81ea\u5df1\u91ca\u653e\u201d\u67d0\u79cd\u7a0b\u5ea6\u4e0a\u5c31\u662f\u4e0d\u5bf9\u7684\u4e00\u4e2a\u89c2\u5ff5\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699434\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kop1989 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u7b2c\u4e00\u6bb5\u8bf4\u201c\u5185\u5b58\u6cc4\u6f0f\u201d\u3002<br \/>\u7b2c\u4e8c\u6bb5\u8f6c\u5934\u5c31\u8bf4\u201c\u4e66\u672a\u8fd8\u201d\uff08\u4e1a\u52a1\u95ee\u9898\uff09\u4e86\u3002<br \/>\u4e3b\u771f\u7684\u60f3\u660e\u767d\u4f60\u5230\u5e95\u8981\u5e72\u4ec0\u4e48\u4e86\u4e48\u3002<br \/>1 \u3001\u6790\u6784\u51fd\u6570\u4f60\u7528\u6765\u5904\u7406\u4e1a\u52a1\uff1f<br \/>2 \u3001\u6709\u56de\u6536\u673a\u5236\u7684\u8bed\u8a00\u600e\u4e48\u4f1a\u6709\u72ed\u4e49\u7684\u3001\u539f\u6559\u65e8\u4e3b\u4e49\u7684\u6790\u6784\u51fd\u6570\uff1f<br \/>3 \u3001\u5efa\u8bae\u4f60\u53bb\u4e86\u89e3\u4e00\u4e0b\u5e26\u6709 GC \u673a\u5236\u8bed\u8a00\u7684\u201c\u9500\u6bc1\u4e8b\u4ef6\u201d\u7684\u7279\u70b9\u4e0e\u6ce8\u610f\u4e8b\u9879\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699435\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Chingim <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u6790\u6784\u51fd\u6570\u5f0f\u7528\u6765\u5904\u7406\u7cfb\u7edf\u8d44\u6e90\u7684, \u4e0d\u662f\u7528\u6765\u5904\u7406\u4e1a\u52a1\u903b\u8f91\u7684<br \/>\u8fd9\u4e2a\u4f8b\u5b50, library \u5e94\u8be5\u4fdd\u7559 student \u7684\u5f15\u7528, \u4e0d\u8981\u8ba9\u4ed6\u4eec\u8dd1\u4e86 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699436\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : aguesuka <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u8fd9\u662f\u8bed\u8a00\u7cdf\u7c95, \u8fde Java \u7684\u6790\u6784\u51fd\u6570 finalize \u4ece 9 \u4e5f\u5f00\u59cb\u8fc7\u65f6\u4e86. <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699437\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : runze <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u53ef\u4ee5\u6709\uff1a https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/FinalizationRegistry<br \/>\u4f46\u662f\u540c\u6837\u4e0d\u63a8\u8350\u7528\u4e8e\u5904\u7406\u4e1a\u52a1\u903b\u8f91 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699438\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ss99604 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> WeakRef \u3001FinalizationRegistry <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699439\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : agagega <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e0a\u771f\u6709\u4eba\u89c9\u5f97\u6790\u6784\u51fd\u6570\u8fd9\u4e2a C++\/Rust\/Swift \u91cc\u91cd\u4e2d\u4e4b\u91cd\u7684\u6982\u5ff5\u662f\u6ca1\u6709\u610f\u4e49\u7684\u7cdf\u7c95\u5417.. RAII \u4e0d\u662f\u7ba1\u7406\u5185\u5b58\u8fd9\u4e48\u7b80\u5355\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699440\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hjahgdthab750 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u6211\u539f\u6765\u4e00\u76f4\u4ee5\u4e3a\u6790\u6784=untuple <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699441\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jadehare <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4f60\u53ef\u4ee5\u4e0a\u8bfe\uff0c\u7761\u89c9\u7684\u65f6\u5019\u8ba9\u4ed6\u4eec\u8fd8\u4e66\uff0c\u6216\u8005\u5220\u9664\u5f15\u7528\u7684\u65f6\u5019\u76f4\u63a5\u8ba9 library \u53bb\u627e\u6bcf\u4e2a\u5b66\u751f\u8981\u4e66 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699442\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shawckzh <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> GC \u8bed\u8a00\u4e0d\u5e94\u8be5 RAII\uff0c\u4e0d\u7136 go \u4e3a\u5565\u4f1a\u6709 defer<br \/>LZ \u8981\u662f\u89c9\u5f97\u663e\u5f0f\u8c03\u7528\u9ebb\u70e6\uff0c\u5efa\u8bae\u81ea\u5df1\u5199\u4e2a\u7b80\u5355\u7684 defer\uff0c\u5c31\u662f\u51fd\u6570\u9000\u51fa\u65f6\u9690\u5f0f\u8c03\u7528\u5457\uff0cwrap \u4e00\u4e0b\u5c31\u884c <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699443\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qq73666 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @darknoll oc,swift \u4e0d\u670d <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699444\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cyberscorpio <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e0d\u7528\u7684\u65f6\u5019\u5c06\u5176\u7f6e\u4e3a null \u5373\u53ef <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699445\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : runze <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @agagega #27 \u4f46\u8fd9\u662f JS \u5440\uff01<br \/>\u4e00\u822c\u90fd\u662f\u5bf9\u6807 Py \u3001PHP\uff0c\u8ddf Java \u3001Go \u5bf9\u6bd4\u5df2\u7ecf\u7b97\u662f\u79bb\u8c31\u4e86\uff0c\u4e3a\u4ec0\u4e48\u8981\u8ddf C++\u3001Rust \u5bf9\u6bd4\uff1f <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699446\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yannxia <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @agagega \u5bf9\u4e8e\u5e26 GC \u7684\u8bed\u8a00\uff0c\u4e1a\u52a1\u903b\u8f91\u7684\u91ca\u653e\uff0c\u662f\u5e94\u8be5\u5728\u81ea\u5df1\u7684\u4ee3\u7801\u8bbe\u8ba1\u91cc\u9762\uff0c\u81f3\u4e8e C++ \u91cc\u9762\u4e5f\u4e0d\u592a\u5efa\u8bae\u6790\u6784\u903b\u8f91\u4e0a\u7684\u4e1c\u897f\u3002<br \/>\u63a8\u8350\u90fd\u662f close hook <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699447\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chenmobuys <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @runze \u5b9e\u9645\u4e0a PHP \u4e5f\u6709\u6790\u6784\u51fd\u6570 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699448\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chairuosen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u7cfb\u7edf\u5185\u7f6e\u7684\u6ca1\u6709\uff0c\u5982\u679c\u786c\u8981\u7528\uff0c\u53ea\u80fd\u628a\u5bf9\u8c61\u7528 defineProperty \u6216\u8005 Proxy \u5b58\u5728\u53e6\u4e00\u4e2a\u5bf9\u8c61\u4e0a\uff0c\u7136\u540e\u76d1\u542c\u7f6e\u7a7a\u65f6\u4e3b\u52a8\u8c03\u4e00\u4e0b\u65e7\u6570\u636e\u7684 destroy \u65b9\u6cd5 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699449\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Pythoner666666 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u6211\u90fd\u5199 JS \u4e86 \u8fd8\u8981\u6211\u624b\u52a8\u8fd8\u56de\u6536\u5185\u5b58\uff1f <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699450\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : avastms <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u6211\u73b0\u5728\u7684\u9879\u76ee\u91cc\u5c31\u5305\u542b\u8fd9\u79cd\u4ee3\u7801\uff0c <br \/>\u76ee\u524d\u5728 js \u73af\u5883\u91cc\u9700\u8981\u7528\u5230 WeakRef \u548c\u76f8\u5173\u7684 FinalizationRegistry\uff0c\u8be6\u60c5<br \/>https:\/\/developer.mozilla.org\/zh-CN\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/FinalizationRegistry <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699451\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jrtzxh020 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u611f\u89c9\u662f\u4f60\u7684\u4e1a\u52a1\u903b\u8f91\u8bbe\u8ba1\u6709\u95ee\u9898 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699452\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ysc3839 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u6709 GC \u7684\u8bed\u8a00\u4e0d\u80fd\u7528 RAII\uff0c\u6bd4\u5982 Python, Java, JavaScript \u90fd\u4e0d\u53ef\u4ee5\u7528 RAII\uff0c\u56e0\u4e3a\u79bb\u5f00\u4f5c\u7528\u57df\u540e\u5bf9\u8c61\u4e0d\u4e00\u5b9a\u7acb\u5373\u91ca\u653e\uff0c\u6790\u6784\u51fd\u6570\u4e0d\u80fd\u53ca\u65f6\u6267\u884c\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u9884\u6599\u4e4b\u5916\u7684\u60c5\u51b5\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699453\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qrobot <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @yxwzaxns #4L \u6211\u60f3\u77e5\u9053 rust \u7b97\u6210\u719f\u7684\u8bed\u8a00\u561b <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699454\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : akira <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u73b0\u5b9e\u793e\u4f1a\u4e5f\u4e0d\u4f1a\u8fd9\u4e48\u9b54\u5e7b\u7684\u554a\uff0c \u6211\u501f\u4e66\u5361\u4e22\u4e86 \uff0c\u4e66\u4e5f\u4e0d\u4f1a\u81ea\u52a8 \u56de\u9000\u5230\u56fe\u4e66\u9986 \u53bb\u7684\u5440 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699455\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 7gugu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e3b\u5e94\u8be5\u662f\u60f3\u8981\u7c7b\u4f3c React \u7684 componentWillUnmount \u7684\u751f\u547d\u5468\u671f\u51fd\u6570\u5427\uff0cFinalizationRegistry \u53ef\u80fd\u662f\u4f60\u60f3\u8981\u7684\u4e1c\u897f\uff1f\u4e0d\u8fc7\u4e1a\u52a1\u5c42\u7684\u4e1c\u897f\uff0c\u5728\u4e1a\u52a1\u5c42\u4e0a\u5904\u7406\u4f1a\u4e0d\u4f1a\u66f4\u597d <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699456\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : James369 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @chairuosen #36 \u6211 js \u6bd4\u8f83\u83dc\uff0c\u5177\u4f53\u600e\u4e48\u505a\uff0c\u613f\u95fb\u5176\u8be6 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699457\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qrobot <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @James369 \u4e3b\u9996\u5148\u4f60\u7406\u89e3\u9519\u8bef\u4e86\u3002 \u6216\u5219\u8bf4\u4f60\u4e0d\u5e94\u8be5\u5728 Student \u91ca\u653e\u7684\u65f6\u5019\u53bb\u505a\u64e6\u9664\u5706\u7684\u64cd\u4f5c\u3002<br \/>\u4f8b\u5982\uff0c \u6211\u5728 Student \u91ca\u653e\u7684\u540c\u65f6\uff0c\u53bb\u521b\u5efa Student \u3002 \u90a3\u4e48\u8fd9\u4e2a\u5bf9\u8c61\u5c06\u6c38\u8fdc\u65e0\u6cd5\u771f\u6b63\u7684\u91ca\u653e\u3002 \u4f8b\u5982\u5728\u91ca\u653e\u7684\u65f6\u5019\u8fdb\u884c\u6267\u884c\u5927\u91cf\u7684\u903b\u8f91\u3002 \u663e\u7136\u8fd9\u662f\u975e\u5e38\u5f71\u54cd gc \u7684\u6027\u80fd\u884c\u4e3a\u3002 <br \/>\u4e0d\u8fc7\u4f60\u53ef\u4ee5\u5728\u8981\u9500\u6bc1\u7684\u65f6\u5019\u3002 \u6267\u884c\u5176\u4ed6\u60c5\u51b5\uff0c \u4f60\u4e0d\u5e94\u8be5\u4f9d\u8d56 gc<br \/>\u4f8b\u5982\u6211\u8bb0\u5f97 java \u7684 gc\uff0c \u53ea\u662f\u505a\u4e00\u4e2a\u5783\u573e\u6807\u8bc6\uff0c \u81f3\u4e8e\u4ec0\u4e48\u65f6\u5019\u8fdb\u884c\u6e05\u7406\uff0c\u8981\u770b gc \u7684\u5fc3\u60c5\u3002<br \/>\u4f8b\u5982\u5728 JS \u4e2d\uff0c \u4f60\u5e94\u8be5\u8fd9\u6837<br \/>&#8220;`js<br \/>let student = new Student()<br \/>\/\/ \u6807\u8bb0\u9700\u8981\u56de\u6536<br \/>delete student;<br \/>\/\/ free \u662f\u4f60\u81ea\u5df1\u81ea\u5b9a\u4e49\u7684\u65b9\u6cd5\uff0c\u7528\u6765\u7f16\u5199\u903b\u8f91\uff0c\u91ca\u653e\u4f60\u7684\u56fe\u7247\u4fe1\u606f\uff0c\u4ee5\u53ca\u64e6\u9664\u5706\u7684\u64cd\u4f5c\u3002<br \/>free(student)<br \/>&#8220;` <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699458\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : renmu123 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> js \u65e2\u975e\u9762\u5411\u5bf9\u8c61\uff0c\u4e5f\u662f\u811a\u672c\u8bed\u8a00\uff0c\u6240\u4ee5\u6ca1\u6709\u6790\u6784\u51fd\u6570\u5f88\u6b63\u5e38 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699459\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qrobot <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @yxwzaxns \u56de\u7b54 4L<br \/>\u6240\u6709\u7684\u8bed\u8a00\uff0c\u65e0\u8bba\u9ad8\u4f4e\u90fd\u9700\u8981\u5173\u5fc3\u5185\u5b58\u95ee\u9898<br \/>1. \u5206\u914d\u4f60\u6240\u9700\u8981\u7684\u5185\u5b58<br \/>2. \u4f7f\u7528\u5206\u914d\u5230\u7684\u5185\u5b58\uff08\u8bfb\u3001\u5199\uff09<br \/>3. \u4e0d\u9700\u8981\u65f6\u5c06\u5176\u91ca\u653e\u5f52\u8fd8<br \/>\u6709\u4e00\u4e9b\u8bed\u8a00\u662f\u9700\u8981\u5f00\u53d1\u8005\u624b\u52a8\u660e\u786e\u8fdb\u884c\u5904\u7406\u7684\uff0c\u4f8b\u5982 rust c\/c++ , \u800c\u6709\u4e00\u4e9b\u662f\u9690\u542b\u5e2e\u4f60\u5904\u7406\u4f8b\u5982 Java Go \u7b49\u7b49\u3002 \u4f46\u662f\u65e0\u8bba\u90a3\u79cd\u4f60\u90fd\u9700\u8981\u5173\u6ce8\u5185\u5b58\u5206\u914d\uff0c\u4ee5\u53ca\u9500\u6bc1\u7684\u95ee\u9898\u3002 <br \/>\u4f8b\u5982\u5728 Java \u4e2d \u5e38\u89c1\u7684\u5185\u5b58\u6cc4\u6f0f<br \/>&#8220;`<br \/>Static Vector v = new Vector(10);<br \/>for (int i = 0; i &lt; 100; i++) {<br \/> Object o = new Object();<br \/> v.add(o);<br \/> o = null;<br \/>}<br \/>&#8220;`<br \/>\u65e0\u8bba\u662f\u90a3\u79cd\u8bed\u8a00\uff0c\u5f00\u53d1\u90fd\u9700\u8981\u5173\u6ce8\u5185\u5b58\u56de\u6536\u7684\u673a\u5236\uff0c\u4ee5\u53ca\u5185\u5b58\u56de\u6536\u7684\u95ee\u9898\u3002\u5982\u679c\u4e0d\u53bb\u5173\u6ce8\u8fd9\u4e9b\u3002 \u5f88\u5bb9\u6613\u51fa\u4e00\u4e9b\u5185\u5b58\u6cc4\u6f0f\u7684\u95ee\u9898\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699460\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : silk <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4f60\u62ff\u660e\u671d\u7684\u5251\u6765\u65a9\u6e05\u671d\u7684\u5b98\uff1f <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699461\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 2i2Re2PLMaDnghL <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u91cd\u65b0\u8bbe\u8ba1\u4e1a\u52a1\u903b\u8f91<br \/>GC \u672c\u6765\u53d1\u751f\u65f6\u95f4\u90fd\u4e0d\u786e\u5b9a\uff0cJS \u67d0\u4e9b\u5b9e\u73b0\u6839\u672c\u4e0d\u8fdb\u884c\u4efb\u4f55 GC\uff0c\u5feb\u901f fork \u4e00\u4efd\u8fd0\u884c\u5b8c\u6574\u4e2a\u8fdb\u7a0b\u4e00\u5e76\u9500\u6bc1\uff0c\u4e0d\u9700\u8981\u4efb\u4f55 GC<br \/>\u672c\u6765\u8bed\u8a00\u5c42\u9762\u4e0a\u5c31\u6ca1\u4fdd\u8bc1\u7684\u4e8b\u60c5\u3002<br \/>\u542c\u8bf4\uff0cScheme \u8bed\u8a00\u8bbe\u8ba1\u4e0a\u6ca1\u6709\u4fdd\u8bc1\u51fd\u6570\u7684\u53c2\u6570\u662f\u4ece\u5de6\u5230\u53f3\u987a\u6b21\u6c42\u503c\u7684\uff0c\u6240\u4ee5\u5b58\u5728\u4e00\u4e9b Scheme \u5b9e\u73b0\u7279\u610f\u4e0d\u6309\u8fd9\u4e2a\u987a\u5e8f\u6c42\u503c\uff0c\u5e76\u4ee5\u53d6\u7b11\u641e\u9519\u4e86\u7684\u4eba\u4e3a\u4e50 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699462\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hjdtl <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e3b\u5728\u5b9e\u9645\u5f00\u53d1\u73af\u5883\u4e2d\u9047\u5230\u4ec0\u4e48\u95ee\u9898\u4e86\u5417\uff1f\u53ef\u4ee5\u5206\u4eab\u51fa\u6765\uff0c\u5927\u5bb6\u5e2e\u4f60\u89e3\u51b3\u3002<br \/>\u4e0d\u8981\u5236\u9020\u865a\u65e0\u95ee\u9898\u4e86 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699463\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zjsxwc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u867d\u7136 swift \u6ca1\u6709 gc\uff0c\u4e5f\u6ca1\u6709\u6790\u6784\u51fd\u6570\uff0c\u4f46 swift \u6709 deinit \u51fd\u6570<br \/>In Swift, destructors are not required, as the memory deallocation is abstracted away and done automatically. However, they are available and known as \u201cdeinitializers\u201d, to perform any cleanup that needs to be done just prior to actual deallocation of the object. Deinitializers are optional, and there can be one at most in a class.<br \/>In our car example, before we send it to the junkyard, we might want to un-register the vehicle\u2019s license and cancel the insurance:<br \/>class Car {<br \/> \/\/properties<br \/> init(model:String, color:String, vin:Int) {<br \/> \/\/ init code<br \/> }<br \/> deinit {<br \/> unRegisterLicense() \/\/ some function that un-registers the license<br \/> cancelInsurance() \/\/ some function that cancels the insurance policy<br \/> }<br \/>} <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699464\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : aneostart173 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u81ea\u5df1\u5199\u4e00\u4e2a\u7c7b\uff0c\u81ea\u5b9a\u4e49\u751f\u547d\u5468\u671f\uff0c\u6240\u6709\u5176\u4ed6\u7c7b\u90fd\u7ee7\u627f\u8fd9\u4e2a\u7c7b\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699465\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chairuosen <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @James369 #44 <br \/>var Obj = function(name){<br \/> this.name = name;<br \/>}<br \/>Obj.prototype.destroy = function(){<br \/> console.log(&#8216;destroy&#8217;, this.name);<br \/>}<br \/>var store = {};<br \/>var myObj = new Obj(&#8216;123&#8217;);<br \/>Object.defineProperty(store, &#8216;myObj&#8217;, {<br \/> get: function(){<br \/> return myObj;<br \/> },<br \/> set: function(newVal){<br \/> if(!newVal){<br \/> myObj &amp;&amp; myObj.destroy();<br \/> }<br \/> myObj = newVal;<br \/> }<br \/>});<br \/>setTimeout(function(){<br \/> store.myObj = null;<br \/>},100) <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699466\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : libook <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e00\u65f6\u95f4\u4e0d\u77e5\u9053\u600e\u4e48\u56de\u590d\u2026\u2026<br \/>\u5173\u4e8e\u5185\u5b58\u6cc4\u6f0f\uff1a<br \/>\u8981\u7528\u5185\u5b58\u7684\u65f6\u5019\u9700\u8981\u7533\u8bf7\uff0c\u7528\u5b8c\u4e86\u8981\u91ca\u653e\uff0c\u8fd9\u4e9b\u64cd\u4f5c\u4ec5\u5b58\u5728\u4e8e\u53ef\u4ee5\u76f4\u63a5\u64cd\u4f5c\u5185\u5b58\u7684\u8bed\u8a00\uff0c\u5982 C \u3001C++\uff0c\u7533\u8bf7\u4e86\u5185\u5b58\u5fd8\u4e86\u91ca\u653e\u4f1a\u5bfc\u81f4\u5185\u5b58\u6cc4\u6f0f\uff0c\u5728\u4e00\u4e9b\u91cd\u4e1a\u52a1\u8f7b\u8d44\u6e90\u7ba1\u7406\u7684\u573a\u666f\u4e0b\uff0c\u4eba\u4eec\u53d1\u660e\u4e86\u4e00\u4e9b\u81ea\u52a8\u91ca\u653e\u5185\u5b58\u7684\u8bed\u8a00\uff0c\u5982 Java \u3001C#\u3001JS \u3001Go\uff0c\u5927\u591a\u662f\u91c7\u7528 GC \u65b9\u6848\uff0c\u4e5f\u6709\u91c7\u7528\u5176\u4ed6\u65b9\u6848\u7684\u5982 Rust \u7684 safe \u7684\u4ee3\u7801\u91c7\u7528 Ownership \u65b9\u6848\u3002<br \/>\u4f46\u4e0d\u662f\u8bf4\u6709\u4e86\u81ea\u52a8\u91ca\u653e\u5185\u5b58\u7684\u65b9\u6848\u5c31\u53ef\u4ee5\u5b8c\u5168\u907f\u514d\u201c\u5185\u5b58\u6cc4\u6f0f\u201d\u4e86\uff0c\u6ca1\u6709\u9075\u7167 GC \u3001Ownership \u7684\u89c4\u5219\u6765\u4f7f\u7528\u540c\u6837\u4f1a\u5bfc\u81f4\u5185\u5b58\u6cc4\u6f0f\uff0c\u6bd4\u5982\u6301\u7eed\u521b\u5efa\u5bf9\u8c61\uff0c\u4f46\u53c8\u8ba9\u5bf9\u8c61\u6301\u7eed\u88ab\u5f15\u7528\uff0cGC \u68c0\u6d4b\u5230\u5bf9\u8c61\u88ab\u5f15\u7528\u5219\u4e0d\u91ca\u653e\u5185\u5b58\uff0c\u53ef\u80fd\u4e1a\u52a1\u4e0a\u5df2\u7ecf\u7528\u4e0d\u5230\u8fd9\u4e9b\u5bf9\u8c61\u4e86\uff0c\u4f46\u5bf9\u8c61\u4f9d\u7136\u8d8a\u6765\u8d8a\u591a\uff0c\u76f4\u5230\u7528\u6ee1\u5185\u5b58\u3002<br \/>\u6240\u4ee5\u5bf9\u4e8e JS \u6765\u8bf4\uff0c\u7edd\u5927\u591a\u6570\u65f6\u5019\u90fd\u4e0d\u9700\u8981\u8003\u8651\u5185\u5b58\u76f8\u5173\u7684\u95ee\u9898\uff0c\u7279\u6b8a\u60c5\u51b5\u4e0b\u8981\u91ca\u653e\u5185\u5b58\u4e5f\u4e0d\u9700\u8981\u501f\u52a9\u6790\u6784\u51fd\u6570\u4e4b\u7c7b\u7684\u7279\u6027\uff0c\u800c\u662f\u968f\u65f6\u90fd\u53ef\u4ee5\u76f4\u63a5\u4e3a GC \u521b\u9020\u6761\u4ef6\u8bf1\u5bfc\u5176\u91ca\u653e\u5185\u5b58\uff0c\u6bd4\u5982\u6253\u7834\u5f15\u7528\u5173\u7cfb\uff0c\u6bd4\u5982\u4f7f\u7528 WakeMap \u3002<br \/>\u5173\u4e8e\u6790\u6784\u51fd\u6570\uff1a<br \/>C \u8bed\u8a00\u4e5f\u6ca1\u6709\u6790\u6784\u51fd\u6570\uff08\u975e OO \u8fde\u6784\u9020\u51fd\u6570\u90fd\u6ca1\u6709\uff09\u3002<br \/>\u6790\u6784\u51fd\u6570\uff08 destructor \uff09\u662f\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u601d\u60f3\u91cc\u7684\u4e00\u4e2a\u6982\u5ff5\uff0c\u5b58\u5728\u4e8e RAII \u65b9\u5f0f\u7684\u573a\u666f\uff0cRAII \u65b9\u5f0f\u7684\u7279\u70b9\u662f\u8d44\u6e90\u7684\u5206\u914d\u548c\u91ca\u653e\u7684\u65f6\u673a\u662f\u88ab\u7cbe\u51c6\u63a7\u5236\u7684\u3002JS \u662f\u4f7f\u7528 GC \u6765\u91ca\u653e\u5185\u5b58\uff0cGC \u7684\u91ca\u653e\u65f6\u673a\u662f\u4e0d\u786e\u5b9a\u7684\uff0c\u800c\u4e14\u5047\u5982\u5bf9\u8c61\u4e0d\u6ee1\u8db3 GC \u91ca\u653e\u8981\u6c42\u7684\u65f6\u5019\u5f3a\u884c\u91ca\u653e\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6709\u4e9b\u8d44\u6e90\u88ab\u63d0\u524d\u91ca\u653e\u4e86\uff0c\u4ece\u800c\u4f7f\u5f97\u5f15\u7528\u5173\u7cfb\u6811\u7d0a\u4e71\uff0c\u8fd9\u4e5f\u662f GC \u8981\u907f\u514d\u7684\u95ee\u9898\u4e4b\u4e00\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528 FinalizationRegistry \u6765\u76d1\u542c\u5bf9\u8c61\u88ab GC \u56de\u6536\u7684\u4e8b\u4ef6\uff0c\u67d0\u79cd\u610f\u4e49\u4e0a\u6765\u8bf4\u53ef\u4ee5\u7b97\u662f\u4e00\u79cd\u201c\u6790\u6784\u51fd\u6570\u201d\uff0c\u4f46\u8fd9\u4e2a\u4e0e\u5176\u4ed6\u5f88\u591a\u8bed\u8a00\u7684\u65b9\u5f0f\u6709\u5f88\u5927\u533a\u522b\uff0c\u5f00\u53d1\u8005\u65e0\u6cd5\u9884\u6599\u8fd9\u4e2a\u4e8b\u4ef6\u4ec0\u4e48\u65f6\u5019\u53d1\u751f\uff0c\u4f46\u5982\u679c\u5951\u5408\u4f60\u7684\u9700\u6c42\u573a\u666f\uff0c\u4e5f\u662f\u53ef\u4ee5\u7528\u7684\u3002\u540c\u65f6\u4e0d\u540c JS \u5f15\u64ce\u5bf9\u4e8e GC \u7684\u5b9e\u73b0\u4e5f\u53ef\u80fd\u6709\u5dee\u5f02\uff0c\u8fc7\u5ea6\u5173\u5fc3\u5185\u5b58\u53ef\u80fd\u4f1a\u5bfc\u81f4\u7a0b\u5e8f\u517c\u5bb9\u6027\u4e0b\u964d\uff0c\u7279\u522b\u662f\u9002\u914d\u95ee\u9898\u5f88\u70e6\u4eba\u7684\u6d4f\u89c8\u5668\u7aef\u5f00\u53d1\u573a\u666f\u3002<br \/>\u5173\u4e8e\u91ca\u653e\u6587\u4ef6\u53e5\u67c4\u3001\u7f51\u7edc\u8fde\u63a5\u3001\u9501\uff1a<br \/>\u8fd9\u4e9b\u8d44\u6e90\u8ddf\u5185\u5b58\u662f\u5b8c\u5168\u4e0d\u540c\u7684\uff0c\u786e\u5b9e\u662f\u9700\u8981\u624b\u52a8\u91ca\u653e\u7684\uff0c\u4f46\u4e0d\u662f\u8bf4\u5fc5\u987b\u7528\u6790\u6784\u51fd\u6570\uff0cC \u8bed\u8a00\u6ca1\u6709\u6790\u6784\u51fd\u6570\uff0c\u9664\u4e86\u8981\u624b\u52a8\u91ca\u653e\u5185\u5b58\u4ee5\u5916\uff0c\u4e5f\u8981\u91ca\u653e\u8fd9\u4e9b\u975e\u5185\u5b58\u8d44\u6e90\u3002<br \/>JS \u4e5f\u4e00\u6837\uff0c\u76f8\u5173 API \u4e5f\u90fd\u63d0\u4f9b\u4e86\u8bf8\u5982 filehandle.close()\u3001writableStream.end()\u4e4b\u7c7b\u7684\u65b9\u6cd5\uff0c\u4f46\u5e76\u4e0d\u4e00\u5b9a\u9700\u8981\u5728\u5bf9\u8c61\u88ab\u56de\u6536\u7684\u65f6\u5019\u91ca\u653e\u3002\u7528 C++\u4e4b\u7c7b\u7684\u8bed\u8a00\u7684\u65f6\u5019\uff0c\u6709\u6790\u6784\u51fd\u6570\u53ef\u4ee5\u7528\u6765\u91ca\u653e\u5185\u5b58\uff0c\u4e8e\u662f\u5f53\u5176\u4ed6\u8d44\u6e90\u751f\u547d\u5468\u671f\u548c\u5bf9\u8c61\u4e00\u6837\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u4e00\u8d77\u653e\u5728\u6790\u6784\u51fd\u6570\u91cc\u91ca\u653e\uff1b\u4f46\u5e76\u4e0d\u662f\u8bf4\u91ca\u653e\u8d44\u6e90\u4e00\u5b9a\u8981\u5728\u6790\u6784\u51fd\u6570\u91cc\u505a\uff0cC++\u4e5f\u53ef\u4ee5\u4e0d\u5728\u6790\u6784\u51fd\u6570\u91cc\u91ca\u653e\u8fd9\u4e9b\u8d44\u6e90\u3002\u4eba\u4eec\u5728\u7528 JS \u7684\u65f6\u5019\uff0c\u538b\u6839\u4e0d\u4f1a\u53bb\u8003\u8651\u5185\u5b58\u91ca\u653e\u7684\u95ee\u9898\uff0c\u6240\u4ee5\u4e5f\u538b\u6839\u4e0d\u4f1a\u8003\u8651\u4f7f\u7528\u6790\u6784\u51fd\u6570\uff0c\u90a3\u4e48\u53ea\u8981\u662f\u7b26\u5408\u4e1a\u52a1\u6d41\u7a0b\u5b9a\u4e49\u7684\u4f4d\u7f6e\uff0c\u90fd\u53ef\u4ee5\u663e\u5f0f\u8c03\u7528\u65b9\u6cd5\u91ca\u653e\u76f8\u5e94\u7684\u8d44\u6e90\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u5728\u4e00\u4e2a\u4ee3\u7801\u6d41\u7a0b\u4e2d\u91ca\u653e\uff0c\u4e5f\u53ef\u4ee5\u76d1\u542c\u76f8\u5e94\u4e8b\u4ef6\u6765\u91ca\u653e\u3002<br \/>\u5982\u679c\u7a0b\u5e8f\u4e2d\u6ca1\u6709\u91ca\u653e\u8d44\u6e90\uff0c\u5f53\u8fdb\u7a0b\u9000\u51fa\u7684\u65f6\u5019\uff08 Node.js \u652f\u6301\u591a\u8fdb\u7a0b\u7f16\u7a0b\uff09\uff0c\u64cd\u4f5c\u7cfb\u7edf\u4e5f\u4f1a\u56de\u6536\u6240\u6709\u8d44\u6e90\uff0c\u5305\u62ec\u5185\u5b58\u3001\u6587\u4ef6\u53e5\u67c4\u3001\u7f51\u7edc\u8fde\u63a5\u7b49\u7b49\u3002<br \/>\u6700\u540e\uff1a<br \/>1. \u4e0d\u77e5\u9053\u9898\u4e3b\u662f\u5426\u660e\u786e\u6e05\u695a\u81ea\u5df1\u662f\u5426\u771f\u7684\u9700\u8981\u6790\u6784\u51fd\u6570\u6765\u91ca\u653e\u8fd9\u4e9b\u8d44\u6e90\uff0c\u5982\u679c\u53ea\u662f\u4ece C++\u4e4b\u7c7b\u7684\u5f00\u53d1\u7cbe\u529b\u5e26\u8fc7\u6765\u7684\u4e60\u60ef\uff0c\u90a3\u5927\u53ef\u4e0d\u5fc5\uff0cJS \u548c\u5176\u4ed6\u8bed\u8a00\u6709\u5f88\u591a\u4e0d\u540c\u70b9\uff0c\u5f88\u591a\u65f6\u5019\u5728\u4e00\u4e2a\u8bed\u8a00\u4e0a\u786c\u5957\u53e6\u4e00\u4e2a\u8bed\u8a00\u7684\u601d\u8def\u4f1a\u6b65\u5c65\u7ef4\u8270\uff0c\u6700\u7ec8\u4f1a\u89c9\u5f97\u8fd9\u4e2a\u8bed\u8a00\u5f88\u96be\u7528\u3002\u4e0d\u5982\u62e5\u62b1\u8fd9\u4e2a\u8bed\u8a00\u81ea\u5df1\u7684\u5f00\u53d1\u4e60\u60ef\uff0c\u53ef\u4ee5\u53c2\u7167\u4e00\u4e9b\u4e3b\u6d41\u9879\u76ee\u7684\u4ee3\u7801\uff0c\u770b\u770b\u5927\u5bb6\u4e00\u822c\u4f1a\u600e\u4e48\u505a\u3002<br \/>2. \u8bed\u8a00\u8868\u8fbe\u7684\u6700\u7ec8\u76ee\u6807\u662f\u8ba9\u522b\u4eba\u51c6\u786e\u7406\u89e3\u81ea\u5df1\u7684\u610f\u601d\uff0c\u6240\u4ee5\u4f7f\u7528\u6982\u5ff5\u7684\u65f6\u5019\u8fd8\u662f\u8981\u591a\u52a0\u659f\u914c\u7684\uff0c\u770b\u662f\u4e0d\u662f\u81ea\u5df1\u60f3\u8868\u8fbe\u7684\u90a3\u4e2a\u610f\u601d\uff0c\u9020\u6210\u8bef\u89e3\u53ef\u80fd\u4f1a\u6709\u5176\u4ed6\u8fde\u5e26\u7684\u9ebb\u70e6\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699467\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : GeruzoniAnsasu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e0d\u63d0 RAII \u7684\u56de\u590d\u5176\u5b9e\u90fd\u53ef\u4ee5\u4e0d\u7528\u770b\u4e86<br \/>\u662f\u7684\u5927\u91cf\u5e26 GC \u7684\u8bed\u8a00\u90fd\u65e0\u6cd5 RAII\uff0c\u4ed6\u4eec\u90fd\u5fc5\u987b\u624b\u52a8\u7ba1\u7406\u8d44\u6e90\u91ca\u653e\u3002\u867d\u7136 golang \u4e4b\u7c7b\u7684\u8bed\u8a00\u6709 defer\uff0c\u4f46\u903b\u8f91\u8ddf RAII \u5b8c\u5168\u4e0d\u540c\uff0c\u662f\u4e24\u5957\u601d\u7ef4\u65b9\u5f0f\u3002<\/p>\n<p>\u4ed6\u4eec\u8fd9\u4e9b\u201c\u811a\u672c\u8bed\u8a00\u201d\u7684\u505a\u6cd5\uff1a<\/p>\n<p>\u6c60\u5316\uff08\u672c\u8d28\u4e0a\u662f\u7531\u5206\u6d3e\u5668\u7ba1\u7406\u8d44\u6e90\uff09 <\/p>\n<p>\u4f9d\u8d56\u6ce8\u5165\uff08\u672c\u8d28\u4e0a\u662f\u5265\u79bb\u8d44\u6e90\u7533\u8bf7\u91ca\u653e\u7684\u4f9d\u8d56\uff0c\u653e\u5230\u7b2c\u4e09\u65b9\uff09 <\/p>\n<p>\u4f7f\u7528 promise\/future \uff08\u672c\u8d28\u4e0a\u662f\u6a21\u4eff RAII \uff09 <\/p>\n<p>\u5b8c\u5168\u629b\u5f03\u72b6\u6001\uff0c\u4f7f\u7528\u51fd\u6570\u5f0f <\/p>\n<p>\u662f\u4e0d\u662f\u5f88\u719f\u6089\uff0c\u300c\u8bbe\u8ba1\u6a21\u5f0f\u300d\u8ddf\u8bed\u8a00\u7279\u6027\u662f\u6709\u5f88\u5927\u76f8\u5173\u6027\u7684 <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699468\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : agagega <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @libook <br \/>\u8fd9\u4e2a\u8ba9\u6211\u60f3\u8d77\u6765\uff0c\u5f88\u591a\u4eba\u6240\u8bf4\u7684\u52a8\u6001\u8bed\u8a00\u91cc\u9762\u7684\u300c\u5185\u5b58\u6cc4\u6f0f\u300d\uff0c\u5b9e\u9645\u4e0a\u662f\u5f15\u7528\u8fd8\u5728\u4f46\u4e1a\u52a1\u4e0a\u4e0d\u9700\u8981\u4e86\uff0c\u5176\u5b9e\u4e0d\u662f\u771f\u6b63\u7684\u5185\u5b58\u6cc4\u6f0f\u3002\u8ddf\u300c\u7c98\u5305\u300d\u6709\u70b9\u50cf\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699469\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : James369 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @libook #54 \u8ba9\u4f60\u8bf4\u5bf9\u4e86\uff0c\u786e\u5b9e\u4ece\u540e\u7aef\u8f6c\u8fc7\u6765\uff0c\u786e\u5b9e\u5f88\u591a\u4e0d\u4e60\u60ef\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699470\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : thtznet <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u5b66\u751f\u501f\u4e86\u4e66\u56de\u5bb6\uff0c\u653e\u5728\u5bb6\u91cc\u7684\u4e66\u684c\u4e0a\uff0c\u8fd8\u6ca1\u6765\u5f97\u53ca\u7ffb\u9875\uff0c\u5b66\u751f\u56e0\u4e3a\u5403\u9519\u836f\u75c5\u53d1\u53bb\u4e16\u4ece\u8fd9\u4e2a\u4e16\u754c\u6d88\u5931\u4e86\uff0c\u8fc7\u4e86 1 \u4e2a\u6708\uff0c\u4e66\u8fd8\u5728\u684c\u4e0a\u3002\u8fd9\u662f\u7b26\u5408\u4e16\u754c\u8fd0\u884c\u7684\u5ba2\u89c2\u89c4\u5f8b\u7684\u3002  <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699471\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhw2590582 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> Student \u5728 Canvas \u4e0a\u753b\u4e86\u4e00\u4e2a\u5706\uff0c\u4f46\u662f Student \u91ca\u653e\u7684\u65f6\u5019\uff0c\u5b83\u4e0d\u4f1a\u505a\u64e6\u9664\u5706\u7684\u64cd\u4f5c<br \/>\u8fd9\u597d\u50cf\u662f\u4e1a\u52a1\u7684\u9500\u6bc1\u903b\u8f91\uff0c\u4e0d\u662f GC \u505a\u7684\u4e8b <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699472\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xarthur <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4f60\u9700\u8981\u7684\u4e0d\u662f\u6790\u6784\u51fd\u6570\uff0c\u4f60\u9700\u8981\u7684\u662f\u751f\u547d\u5468\u671f\u51fd\u6570\uff0c\u8fd9\u4e2a\u4f60\u81ea\u5df1\u5b9a\u4e49\u5c31\u884c\u4e86\u3002<br \/>\u53ea\u662f\u4e4b\u524d\u628a\u8981\u5728\u751f\u547d\u5468\u671f\u51fd\u6570\u91cc\u505a\u7684\u5de5\u4f5c\u653e\u5230\u6790\u6784\u51fd\u6570\u91cc\u4e86\u2026\u2026 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699473\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fyxtc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e3b\u5e94\u8be5\u662f\u5b66\u751f\u5427\uff1f\u6790\u6784\u548c GC \u4fdd\u8bc1\u7684\u5e94\u8be5\u662f Student \u9500\u6bc1\u7684\u65f6\u5019\uff0c\u518d\u6b21\u5f15\u7528\u5b9e\u4f8b stu \u80fd\u4fdd\u8bc1\u4e0d\u53ef\u80fd\u53d6\u5230\u66fe\u7ecf\u5b58\u5728\u7684\u4efb\u4f55\u4fe1\u606f\uff08\u5f53\u7136\u5305\u62ec\u501f\u4e66\u4fe1\u606f\uff09\uff0c\u53cd\u4e4b\u5c31\u662f\u5185\u5b58\u6cc4\u9732\uff08\u6240\u4ee5\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48 C\/C++\u6709\u5185\u5b58\u6cc4\u9732\u95ee\u9898\uff0c\u56e0\u4e3a\u9700\u8981\u4f60\u81ea\u5df1\u53bb\u624b\u52a8\u63a7\u5236\uff09\u3002\u800c\u65e2\u7136\u4f60\u662f\u624b\u52a8\u8c03\u7528\u8ba9 stu \u53bb\u501f\u4e86\uff0c\u81ea\u7136\u5e94\u7528\u7531\u4f60\u6765\u624b\u52a8\u5f52\u8fd8\uff0c\u8fd9\u4e0d\u662f\u8bed\u8a00\u5c42\u9762\u7684\u95ee\u9898\uff0c\u6240\u4ee5\u4e0d\u5e94\u8be5\u4f9d\u8d56\u4efb\u4f55\u8bed\u8a00\u8bbe\u8ba1\u7684\u8bed\u6cd5\uff0c\u6362\u8a00\u4e4b\uff0c\u5c31\u7b97\u6709\u6790\u6784\uff0c\u4f60\u80af\u5b9a\u4e5f\u9700\u8981\u5728\u7279\u5b9a\u7684\u751f\u547d\u5468\u671f\u5185\u53bb\u663e\u5f0f\u8c03\u7528\u6790\u6784\uff08\u901a\u8fc7 delete \u4e4b\u7c7b)\u800c\u4e0d\u5e94\u8be5\u4f9d\u8d56\u81ea\u52a8\u8c03\u7528\u3002<br \/>\u5c31\u62ff\u4f60\u4e3e\u7684\u4f8b\u5b50\u6765\u8bf4\uff0c\u5982\u679c\u4e0d\u662f\u901a\u8fc7 new \u521b\u5efa\u7684\uff0c\u90a3\u4e48\u79bb\u5f00\u4f5c\u7528\u57df\u81ea\u52a8\u6790\u6784\uff0c\u90a3\u4e48\u4f60\u5c31\u5e94\u8be5\u5728\u79bb\u5f00\u4f5c\u7528\u57df\u7684\u65f6\u5019\u8c03\u7528\u8fd8\u4e66\uff0c\u5f88\u76f4\u63a5\u7684\u7ebf\u6027\u5173\u7cfb\u3002\u5982\u679c\u662f new \u51fa\u6765\u6216\u8005\u6709\u5b58\u5728\u5176\u4ed6\u5730\u65b9\u7684\u5f15\u7528\u7684\uff0c\u90a3\u4e48\u80af\u5b9a\u662f\u5728\u4e4b\u540e\u67d0\u4e2a\u901a\u77e5\u4e0b\u89e6\u53d1\u5b66\u751f\u9500\u6bc1\u4e86\uff0c\u90a3\u4e48\u5c31\u5e94\u8be5\u5728\u90a3\u91cc\u8c03\u7528\u8fd8\u4e66\uff0c\u800c\u4e0d\u662f\u4f9d\u8d56\u6790\u6784\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699474\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ragnaroks <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u8fd9\u4e2a\u4e8b\u60c5\u8ba9\u6211\u60f3\u5230 blazor \u5b98\u65b9\u793a\u4f8b\u6700\u5f00\u59cb\u5728 page \u91cc\u9762\u6709\u4e2a timer \u66f4\u65b0\u9875\u9762\u65f6\u95f4\uff08\u8868\u73b0\u53cc\u5411\u66f4\u65b0\u6548\u679c\uff09\uff0c\u4f46\u662f\u56e0\u4e3a blazor \u6ca1\u6709\u201c\u4e3b\u52a8\u91ca\u653e\u201d\u5bfc\u81f4\u5927\u91cf\u8bbf\u95ee\u540e\u5c31\u4f1a\u585e\u7206\u5185\u5b58\u3002<br \/>btw\uff0c\u73b0\u5728\u4e5f\u6ca1\u6709 OnDestory \u7684\u4e8b\u4ef6\uff0c\u4f46\u662f\u53ef\u4ee5\u5b9e\u73b0 IDispose \u63a5\u53e3 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699475\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : namelosw <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> &gt; \u6b63\u89c4\u8bed\u8a00\u90fd\u6709\u6790\u6784\u51fd\u6570<br \/>\u4f60\u8fd9\u8bf4\u5f97\u4e49\u6b63\u8f9e\u4e25\u7684\u3002\u6211\u731c\u4f60\u7528\u8fc7\u7684\u6b63\u89c4\u8bed\u8a00\u53ea\u6709\u4e00\u4e2a\u54c8\u54c8\u54c8\u54c8\u3002<br \/>\u8fde C \u90fd\u6ca1\u6709\u4e0d\u7528\u6790\u6784\u51fd\u6570\uff0cRust \u90fd\u4e0d\u600e\u4e48\u7528\u6790\u6784\u51fd\u6570\uff0c\u66f4\u522b\u63d0 Java \u548c JavaScript \u4e86\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699476\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : aloxaf <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @namelosw Rust \u54ea\u6709\u300c\u4e0d\u600e\u4e48\u7528\u300d\uff0c\u660e\u660e\u5230\u5904\u90fd\u662f <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699477\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zxCoder <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u8fd9\u4e2a\u8ddf\u6790\u6784\u51fd\u6570\u6ca1\u6709\u5173\u7cfb\u5427\uff0c\u8fd9\u4e2a\u662f\u4e1a\u52a1\u903b\u8f91\u7684\u95ee\u9898 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699478\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : WilliamYang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u53c8\u4e00\u4e2a XY \u95ee\u9898\uff0c\u4f60\u9700\u8981\u7684\u662f\u4e1a\u52a1\u600e\u4e48\u5904\u7406\uff0c\u800c\u4e0d\u662f\u95ee\u6709\u6ca1\u6709\u6790\u6784\u51fd\u6570 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699479\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ipwx <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> gc \u8bed\u8a00\u5e94\u8be5\u8981\u663e\u5f0f close\uff0c\u56e0\u4e3a\u4f60\u65e0\u6cd5\u63a7\u5236 gc \u4ec0\u4e48\u65f6\u5019\u8c03\u7528\u6790\u6784\u51fd\u6570\uff0c\u662f\u5de8\u5927\u7684 bug \u9690\u60a3\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699480\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : TypeError <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u5185\u5b58\u91ca\u653e\u9760 gc<br \/>\u8d44\u6e90\u91ca\u653e\u9760\u624b\u52a8\u6216\u8005\u8bed\u6cd5\u4fdd\u8bc1\uff08 Python with\/Golang defer \uff09<br \/>https:\/\/stackoverflow.com\/questions\/62879698\/any-tips-on-context-manager-similar-to-python-in-javascript <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699481\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : liberize <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u8bf4\u767d\u4e86\uff0c\u8fd9\u4e9b\u6ca1\u6790\u6784\u51fd\u6570\u7684\u8bed\u8a00\u5c31\u662f\u5f97\u63d0\u4f9b\u4e00\u4e2a close \u63a5\u53e3\uff0c\u624b\u52a8\u8c03\u7528 close <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699482\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zjsxwc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> GC \u8bed\u8a00\uff08 PHPJAVA \uff09\u7684\u6790\u6784\u51fd\u6570\uff08__destruct\/finalize \uff09 != RAII \u8bed\u8a00\uff08 C++\uff09\u7684\u6790\u6784\u51fd\u6570 \uff08~xx \uff09 != ARC \u8bed\u8a00\uff08 oc\/swift \uff09\u7684\u6790\u6784\u51fd\u6570\uff08 dealloc\/deinit \uff09 != \u6240\u6709\u6743\u8bed\u8a00\uff08 Rust \uff09\u7684\u6790\u6784\u51fd\u6570\uff08 drop \uff09 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699483\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zjsxwc <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e0a\u9762 4 \u7c7b\u8bed\u8a00\u4e2d\uff0c\u53ea\u6709 GC \u8bed\u8a00\u5b58\u5728 STW \u5361\u987f\u73b0\u8c61\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699484\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Building <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u5728\u91ca\u653e\u51fd\u6570\u6267\u884c\u8fd8\u4e66\u64cd\u4f5c\u672c\u8eab\u5c31\u4e0d\u5408\u7406\u5427\u3002<br \/>1. \u4e66\u548c\u5b66\u751f\u4e92\u76f8\u5f15\u7528\uff0c\u8fd9\u6837\u6839\u672c\u8d70\u4e0d\u5230\u91ca\u653e\u51fd\u6570\u3002<br \/>2. \u4e66\u548c\u5b66\u751f\u65e0\u4e92\u76f8\u5f15\u7528\uff0c\u5b66\u751f\u91ca\u653e\u4e86\u5e76\u4e0d\u4f1a\u5f71\u54cd\u8fd8\u4e66\u3002<br \/>3. \u5982\u679c\u5fc5\u9700\u8981\u6267\u884c\u8fd8\u4e66\u64cd\u4f5c\uff0c\u4e66\u548c\u5b66\u751f\u4e0d\u76f8\u4e92\u5f15\u7528\uff0c\u5374\u80fd\u63d0\u524d\u91ca\u653e\u5b66\u751f\uff0c\u8fd9\u4e2a\u5728\u8bbe\u8ba1\u4e0a\u6ca1\u6709\u95ee\u817f\u5417 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699485\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wangxin13g <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u6790\u6784\u51fd\u6570\u4e0d\u5e94\u8be5\u6709\u4efb\u4f55\u4e1a\u52a1\u5c42\u9762\u4e0a\u7684\u64cd\u4f5c\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699486\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qq1009479218 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u624b\u52a8\u6790\u6784 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699487\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : aleen42 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> [Memory Leak]( https:\/\/wiki.aleen42.com\/Programming\/JavaScript\/memory_leak\/memory_leak.html) situations in JavaScript  <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699488\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lbyo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @qrobot #47 <br \/>&gt; \u6709\u4e00\u4e9b\u8bed\u8a00\u662f\u9700\u8981\u5f00\u53d1\u8005\u624b\u52a8\u660e\u786e\u8fdb\u884c\u5904\u7406\u7684\uff0c\u4f8b\u5982 rust c\/c++<br \/>Ownership is Rust\u2019s most unique feature, and it enables Rust to make memory safety guarantees without needing a garbage collector. <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699489\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : KuroNekoFan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e3b\u662f\u628a OO \u548c\u7f16\u7a0b\u8bed\u8a00\u80fd\u529b\u641e\u6df7\u4e86\u5417 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"6699490\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : liuhan907 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @GeruzoniAnsasu<br \/>\u4e00\u5708\u56de\u590d\u770b\u4e0b\u6765\uff0craii \u90fd\u5df2\u7ecf\u662f\u65f6\u4ee3\u7684\u773c\u6cea\u4e86\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>js \u7684\u7c7b\u6709\u6ca1\u6709\u6790\u6784\u51fd\u6570\uff0c\u5982\u4f55\u8fdb\u884c&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/535370"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=535370"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/535370\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=535370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=535370"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=535370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}