×
Namespaces

Variants
Actions
(Difference between revisions)

Archived:Garbage collecting prohibitively slows S60 2nd Edition (Known Issue)

From Nokia Developer Wiki
Jump to: navigation, search
extkbeditor2 (Talk | contribs)
m
hamishwillee (Talk | contribs)
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{KBKI}}
+
{{Archived|timestamp=20120608174516|user=[[User:Lpvalente|Lpvalente]]}}
__NOTOC__
+
[[Category:Known Issue]][[Category:Java ME]][[Category:S60 2nd Edition (initial release)]]
__NOEDITSECTION__
+
 
{{KnowledgeBase
+
 
|id=KIJ000080
+
{{ArticleMetaData <!-- v1.2 -->
|platform=S60 2nd Edition  
+
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
|devices=Nokia 6600
+
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
|category=
+
|devices= Nokia 6600
|subcategory=
+
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
|creationdate=
+
|platform= S60 2nd Edition
|keywords=
+
|devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20070816
 +
|author= [[User:Technical writer 1]]
 +
<!-- The following are not in current metadata -->
 +
|subcategory=
 +
|id= KIJ000080
 
}}
 
}}
  
 
==Description==
 
==Description==
Calling the System.gc() method results in extreme slowness and jamming. In Monty 1.0 VM, garbage collection is different and every time System.gc is called, the entire memory is really cleared. This is an extremely slow process!
+
{{Abstract|Calling the System.gc() method results in extreme slowness and jamming. In Monty 1.0 VM, garbage collection is different and every time System.gc is called, the entire memory is really cleared. This is an extremely slow process!}}
  
 
==Solution==
 
==Solution==
 
Do not call the System.gc method at all, or call the System.gc() garbage collecting method only in non-time-critical situations, such as screen transitions, state transitions, pause states, etc. If the System.gc() method is used, it is recommended to add a short delay (<nowiki>~</nowiki>20-50 ms) after the method call to ensure the sufficient time for the garbage collection, as in the following example:
 
Do not call the System.gc method at all, or call the System.gc() garbage collecting method only in non-time-critical situations, such as screen transitions, state transitions, pause states, etc. If the System.gc() method is used, it is recommended to add a short delay (<nowiki>~</nowiki>20-50 ms) after the method call to ensure the sufficient time for the garbage collection, as in the following example:
  
&nbsp;System.gc();
+
<code java>
 +
System.gc();
 +
 
 +
Thread.sleep(delay); //delay = 20-50 ms
  
&nbsp;Thread.sleep(delay); //delay = 20-50 ms
+
</code>
[[Category:Known Issue]][[Category:Java ME]][[Category:S60 2nd Edition]]
+

Revision as of 04:53, 19 June 2012

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

The article is believed to be still valid for the original topic scope.


Article Metadata
Tested with
Devices(s): Nokia 6600
Compatibility
Platform(s): S60 2nd Edition
S60 2nd Edition (initial release)
Article
Created: User:Technical writer 1 (16 Aug 2007)
Last edited: hamishwillee (19 Jun 2012)

Description

Calling the System.gc() method results in extreme slowness and jamming. In Monty 1.0 VM, garbage collection is different and every time System.gc is called, the entire memory is really cleared. This is an extremely slow process!

Solution

Do not call the System.gc method at all, or call the System.gc() garbage collecting method only in non-time-critical situations, such as screen transitions, state transitions, pause states, etc. If the System.gc() method is used, it is recommended to add a short delay (~20-50 ms) after the method call to ensure the sufficient time for the garbage collection, as in the following example:

System.gc();
 
Thread.sleep(delay); //delay = 20-50 ms
66 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×