×
Namespaces

Variants
Actions

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

From Nokia Developer Wiki
Jump to: navigation, search

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
CompatibilityArticle
Created: User:Technical writer 1 (16 Aug 2007)
Last edited: hamishwillee (16 Aug 2013)

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
This page was last modified on 16 August 2013, at 06:54.
96 page views in the last 30 days.