Code Monkey home page Code Monkey logo

Comments (11)

bang590 avatar bang590 commented on July 26, 2024 4

公司内发现一个很有才的方法强制进行垃圾回收:

(function(){
  var x = {};
  for(var i = 0;i<10000;i++){
    x[i]=[];
  };
  x=null;
})();

from jspatch.

bang590 avatar bang590 commented on July 26, 2024

JS会在垃圾回收时释放,目前找到手动回收的方法。

from jspatch.

leafduo avatar leafduo commented on July 26, 2024

In this article, the author mentioned a way to force GC:

for(i=0; i<4100; i++){
  a = .5;
}

Never tried myself, but may be helpful.

from jspatch.

honghewang avatar honghewang commented on July 26, 2024

能不能在JPForwardInvocation函数中,将参数slf封装成JPBoxing对象传过去?
[argList addObject:[JPBoxing boxWeakObj:slf]]; (JPEngine line:437)

from jspatch.

whihail avatar whihail commented on July 26, 2024

@bang590 navigationController pop 时为什么要在js垃圾回收时进行释放,这个不是oc层面的问题么?有些不解?

from jspatch.

fanghongjia avatar fanghongjia commented on July 26, 2024

@bang590 ,“JS会在垃圾回收时释放,目前找到手动回收的方法。”;请问,如何手动回收?

from jspatch.

whihail avatar whihail commented on July 26, 2024

@fanghongjia 你说你找到了手动回收的方法,请问怎么回收呢?

from jspatch.

joliylee avatar joliylee commented on July 26, 2024

如何立即手动回收?

from jspatch.

bingbingBang avatar bingbingBang commented on July 26, 2024

强制垃圾回收这个方法, 好像在频繁push pop 的时候有时会让应用卡死

from jspatch.

Zhangyanshen avatar Zhangyanshen commented on July 26, 2024

到底这个问题怎么解决呢?这里好像没给出具体的解决办法吧? @bang590

from jspatch.

lungfei avatar lungfei commented on July 26, 2024

如何立即回收内存? @joliylee @Zhangyanshen @bang590

from jspatch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.