不知道多少人存在这个误解:
来源:互联网 发布:9.3.5越狱优化 编辑:程序博客网 时间:2024/04/29 21:26
- When the script engine is shut down, garbage is collected.
- When 256 variants, or more than 64KB of strings, or more than 4096 array slots have been allocated, the garbage collector sets a flag that says collect soon.
- Whenever a new statement is executed or the script debugger starts, that flag is checked, and if it is set, a collection is done.
看到这篇帖子的朋友不知道有多少人看过上面三条规则,如果你从搜索引擎搜索javascript delete object的话会经常看到上面这三条,但是这3条规则其实是针对Jscript的,跟javascript没有关系的
全文:
JScript uses a mark-and-sweep garbage collector with a variety of heuristics used to determine when to run garbage collection. The JScript garbage collector works like this:
There is an undocumented JScript function called CollectGarbage that forces a garbage collection. This is for testing purposes only—do not ship code that calls this function. It is a poor programming practice to write code in JScript that depends on garbage collections being done at particular times. If you need predictable garbage collection, use a language that supports it (like Visual Basic® or VBScript). Note that all of this is the implementation detail of the engine and should not be relied upon because it may change in the future. Note also that the version of JScript supported by Microsoft® .NET will use the .NET Framework garbage collector, a multigenerational mark-and-sweep collector.
And remember, if you want a deterministic-lifetime app, use a deterministic-lifetime language like C++, Visual Basic 6.0, or VBScript; not an indeterministic-lifetime language like JScript, Scheme, or Java. If you're writing a program that depends on being able to have a deterministic object lifetime, JScript is not the right tool for the job. Trying to make it a deterministic-lifetime language will just create headaches down the road.
- 不知道多少人存在这个误解:
- 这个原先不知道...
- 不知道遗忘了多少事,多少人...
- DOS命令的使用--不知道这个是我写的多少篇了
- 多少个你不知道
- 不知道这个是什么错误?
- 这个我真不知道
- SAS9.2已经出来,不知道多少人感兴趣?
- 不知道为什么,就是佩服这个牛人!
- 痘痘,多少事你不知道自己不知道?
- 不知道多少个DOS命令在内
- 不知道怎么用这个博客
- 数组,这个居然还不知道!
- 不知道这个是不是.NET的Bug
- 不知道这个有没有分
- 真不知道这个平时没事儿总爱玩点
- 这个人今年多少岁
- 很多人似乎对液晶刷新率存在误解
- 月薪一万的工作
- 关于Hibernate一个配置参数hibernate.hbm2ddl.auto
- ......以后.......
- Java标准版的EJB Persistence(一上)
- 使用Java扩展XSL
- 不知道多少人存在这个误解:
- Internal .Net Framework Data Provider error 6
- Java标准版的EJB Persistence(一下)
- 在JAVA里面如何调用ORCALE数据库里的存储过程(带输入输出参数)的????
- 中文分词算法
- IWebPartParameters makes Connection between Web Parts easy
- 洋流[Theocean flow]介绍----科普知识
- TranslateMessage
- 计算两个日期之间相差的天数(JS)