admin管理员组

文章数量:1024615

I had a long discussion with my friend about PhoneGap. He said that PhoneGap has no garbage collection scenario. I searched for Javascript garbage collection and found the following links:

What is JavaScript garbage collection?

How to write low garbage real-time Javascript

Now this is the question: Does PhoneGap have garbage collector (or PhoneGap apps have been handled automatically like native ones)? If the answer is yes, is it similar to the javascript garbage collector?

I appreciate your ments :)

I had a long discussion with my friend about PhoneGap. He said that PhoneGap has no garbage collection scenario. I searched for Javascript garbage collection and found the following links:

What is JavaScript garbage collection?

How to write low garbage real-time Javascript

Now this is the question: Does PhoneGap have garbage collector (or PhoneGap apps have been handled automatically like native ones)? If the answer is yes, is it similar to the javascript garbage collector?

I appreciate your ments :)

Share Improve this question edited May 23, 2017 at 11:53 CommunityBot 11 silver badge asked May 7, 2013 at 12:09 Majid AbarghooeiMajid Abarghooei 6637 silver badges22 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

Before the answer, I'd like to clarify a point. There isn't a global "JavaScript garbage collector" for all browsers, each JavaScript implementation has a different method for handling it. While I'd guess that most implementations are very similar, how garbage collection happens could differ between Firefox, Chrome, Safari, etc. based on the underlying engine.

A PhoneGap app is essentially a wrapper around a specialized native view that can render HTML and run JavaScript. For Android, this is a WebView, based on the Android Browser. For iOS, it's a similar setup which uses Mobile Safari's engine. Each platform will have its own way of running your code.

Marrying these two points, PhongGap doesn't contain any explicit garbage collection because it is already implemented in the underlying web engine. An Android PhoneGap Application will use Android Browser garbage collection, an iOS PhoneGap App will use Safari garbage collection, etc. While you can be reasonably certain that garbage collection will occur with your PhoneGap app, you may see different results between platforms.

I had a long discussion with my friend about PhoneGap. He said that PhoneGap has no garbage collection scenario. I searched for Javascript garbage collection and found the following links:

What is JavaScript garbage collection?

How to write low garbage real-time Javascript

Now this is the question: Does PhoneGap have garbage collector (or PhoneGap apps have been handled automatically like native ones)? If the answer is yes, is it similar to the javascript garbage collector?

I appreciate your ments :)

I had a long discussion with my friend about PhoneGap. He said that PhoneGap has no garbage collection scenario. I searched for Javascript garbage collection and found the following links:

What is JavaScript garbage collection?

How to write low garbage real-time Javascript

Now this is the question: Does PhoneGap have garbage collector (or PhoneGap apps have been handled automatically like native ones)? If the answer is yes, is it similar to the javascript garbage collector?

I appreciate your ments :)

Share Improve this question edited May 23, 2017 at 11:53 CommunityBot 11 silver badge asked May 7, 2013 at 12:09 Majid AbarghooeiMajid Abarghooei 6637 silver badges22 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

Before the answer, I'd like to clarify a point. There isn't a global "JavaScript garbage collector" for all browsers, each JavaScript implementation has a different method for handling it. While I'd guess that most implementations are very similar, how garbage collection happens could differ between Firefox, Chrome, Safari, etc. based on the underlying engine.

A PhoneGap app is essentially a wrapper around a specialized native view that can render HTML and run JavaScript. For Android, this is a WebView, based on the Android Browser. For iOS, it's a similar setup which uses Mobile Safari's engine. Each platform will have its own way of running your code.

Marrying these two points, PhongGap doesn't contain any explicit garbage collection because it is already implemented in the underlying web engine. An Android PhoneGap Application will use Android Browser garbage collection, an iOS PhoneGap App will use Safari garbage collection, etc. While you can be reasonably certain that garbage collection will occur with your PhoneGap app, you may see different results between platforms.

本文标签: javascriptPhoneGap Garbage CollectionStack Overflow