Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:Playing large audio files using Java ME InputStream throws an OutOfMemoryError (Known Issue)

From 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}}.

If an audio player is created using the Manager.createPlayer(InputStream in, String mimeType) and large audio files are played, Series 40 2nd and 3rd Edition devices run out of memory.

Article Metadata
Tested with
Devices(s): All devices with MMAPI
Created: User:Technical writer 1 (20 Aug 2007)
Last edited: hamishwillee (14 Aug 2013)


If an audio player is created using the Manager.createPlayer(InputStream in, String mimeType), the player tries to read the entire stream to heap memory. At about 700 kB the device throws an OutOfMemoryError. This does not happen if the audio player is created by using the form Manager.createPlayer(String fileUrl). While this player does play songs of unlimited length, it expects a cleartext media file.

How to reproduce

Create audio player by using form Manager.createPlayer(InputStream in, String mimeType) and try to play back a large (> 1MB) audio file.


Some of the Series 40 3rd Edition FP2 devices support audio streaming, but only for specific audio formats (MP3, MP4 and AAC). Streaming must also be explicitly requested by the MIDlet using a special JAD attribute that causes all players to attempt streaming if they support the given content type and protocol. The JAD tag that the MIDlet must define is as follows:

progressive_download: enabled

Note: MetaDataControl is unsupported for Players that use this feature. For the other Series 40 devices, there is currently no solution.

This page was last modified on 14 August 2013, at 11:40.
71 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.