Advertisements:




Does Android.media.soundpool Cause Memory Leak


I found these code may case memory leak on android 2. 1

Code:.

Every time after the execution, the mat pluging tells that two string objects of "android:unnamed_thread" are added to the heap of the process.


View Full Post With 2 Replies

Related Forum Messages:

Please Follow Index to Quick Jump to the Message.


Sqlite Memory Leak ?

Leak found

Code:.

This is the stack trace of my memory leak. Below is the source code for my data helper. In addition to an activity, i also have a service accessing the data. This must be a piece of cake for experienced developers.

Code:.


Posted On: Sep 15 at 17:54 . View Related Posts . . View 1 Replies .

Listview Memory Leak?

I seem to be having some kind of memory leak issue with my listview. The list view activity is in a tab and each row downloads an image and displays it in an imageview (tiling it as a backgroiund).

I am using a cache similar to droidfu http://github.com/kaeppler/droid fu/blob/master/src/main/java/com/github/droidfu/imageloader/imagecache. Java

Everything seems to work fine as i'm completely clearing the memory cache when it gets past 20 items and also completely clearing the disk cache when it gets past 0. 5mb just to be safe. The problem occurs when i have a large list of items in the list (say 100) and i keep scrolling back and forth this list as fast as i can.

Eventually i get these messages in logcat:

Code:.

And a whole bunch of those which lead to a force close. I'm not too sure what the problem is or how to go about fixing it.

Here is the full log: http://pastebin.com/mghmdbxs

Turns out its the problem is with too many asynctask/thread objects being created. I am using the code from http://code.google.com/p/android-imagedownloader/ and not sure how to get this fixed.


Posted On: Sep 14 at 13:30 . View Related Posts . . View 1 Replies .

Memory Leak Using Listactivity

I have an application that uses a service and some list activities. When the activities are opened, i can see the heap usage increase in ddms, when the activities are closed, the heap usage decreases slightly. The service is still running in the background at this point. If the activity is started again by re-running the application and the closed, the heap usage increases again then decreases, but never returns to the original level before the activity was first opened. If it repeatedly (10-15 times) open the activity then close the activity, the heap size (both mb and # objects) balloons!

I'd expect listactivity's ondestroy to take care of itself when it gets destroyed. What am i missing with this? Am i using listactivity incorrectly?

A test app similar to my real code is below. Create a new android application, add this to the manifest:

Code:.

And these java files:

Code:.


Posted On: Oct 11 at 22:46 . View Related Posts . . View 2 Replies .

Memory Leak Because Of Httpclient

I'm developing an android application, consisting in various activities and a service which is activated by "main" activity. The service checks every 3 seconds (this interval is arbitrary) about active network connections into mobile phone. If there's a connection to a pc inside my local network, i then make a call to a web server there.

The problem is, i try to reach host pc through this function:

Code:.

I do use this method, instead of checking wifimanager's and internal android methods, because i have a situation like this: i can be connected to an open-encryption ap, but it has a login system (coova). Here, i can be associated (and have an ip inside lan), but if i'm not logged i won't have access to any network, so i have to implement a "network-checking-wrapper".

So, if there was an exception in execute function because my host pc isn't reachable, ddms will show me how heap size and allocation size will grow without control. I suspect that it's because of the sub-calls inside "execute" don't properly close obsolete references. For instance, here's a example of allocation tracker:

Code:.


Posted On: Aug 25 at 19:07 . View Related Posts . . View 1 Replies .

Memory Leak With A Listview Revisited

I am still struggling with a memory leak associated with a listview. I have created the following small program which exhibits this behavior.

What i do is create 2 linearlayouts. The first has a button and a glistview control. The code for glistview is below, but it just sub- classes listview, and implements the listadapter interface. When the glistview is created, it sets it's adapter to itself.

Now when you press the button i switch to the second linearlayout. This layout has only a single button. When you press this button, i create a new 1st layout with a new glistview and set it as the active view.

Run the program, and switch between the two views 20 times. Then bring up the ddms and force a garbage collection. Then dump the heap, and use the memory analyzer and you will find 21 glistview objects remaining. That is, the 20 glistviews that are not longer connected to anything have not been freed.

Now if i comment out the 'setadapter(this)' function in the glistview constructor and repeat the above, i find that there is only 1 glistview that remains. That is, in this case, all of the unused glistviews have been properly recycled.

Someone suggested that i create a private class within my glistview to handle the listadapter interface, and i tried that, but it did not help.

Surely there is some way to make these objects go away when they are no longer used anywhere. (Isn't that what garbage collection is all about?)

Code:.


Posted On: Oct 21 . View Related Posts . . View 9 Replies .

Memory Leak Due To Asynctask

I'm stuck with a memory leak that i cannot fix. I identified where it occurs, using the memoryanalizer but i vainly struggle to get rid of it.

Here is the code:

Code:.

The activity is terminated on a button click, like this:

Code:.

Memoryanalyzer indicated the memory leak at:

Code:.


Posted On: Jun 13 at 16:30 . View Related Posts . . View 1 Replies .

Memory Leak When Creating Onclicklistener

If anyone could point our a way to avoid the following memory leak.

When switching layouts in a single activity, and assigning onclicklisteners to buttons, each assignment looks to leak a bit of memory.

Below is a quick example application that shows it happening with two button's and a simple function to switch which layout is currently active. If run, you'll see the used memory jump slightly with each click between them.

I'm aware there's plenty of ways around it (using multiple activities for each layout, using a single onclicklistener thats a member variable which gets assigned to it each time), just curious as to where that extra reference is going thats not getting collected.

Code:.


Posted On: Aug 15 2009 . View Related Posts . . View 12 Replies .

Memory Leak When Closing And Restarting Appliction Several Times

Using 'ddms' and repeatably clicking sysinfo -> update from device helped me find a memory leak. So we have 9 junit test cases spread amongst 4 files, and we run them in eclipse. After each test cases finishes, our application is exiting; and it restarts again for the next test case. So for now, that's 9 times our app is closing and restarting, which would be fine, except that each time it close it leaks memory so that there is less available for the next test.

All we have for @before and @after is this:

Code:.

Questions:

1. What's the proper solution?  Find a way to only start the app one time then run all tests?  Or fix the leak?

2. To fix the leak, is there something we're missing/forgetting to do in the @after method?

3. Is there somewhere particular in the positron code that i can do a garbage collect() that might help?


Posted On: Apr 20 2009 . View Related Posts . . View 2 Replies .

Memory Leak In Layout With An Image File Statically Linked As Background

My friend was quoting as said below. Can somebody validate his statement whether it is true.

Quote :

Apparently there is a problem in ui framework with drawable resources management. If an activity uses a layout with an image file statically linked as background (and possibly some other attributes), every time the activity is created, a new bitmap object is generated and never gets released, which eventually leads to out of memory exception.

I created a simple test app, which uses a really big png file (850kb, 1650x1275px) set as background in the activity's main layout xml. After two attempts of screen orientation change, on which event the activity gets destroyed and then recreated, the application crashed with the subject exception. Recycling the background bitmap object in the activity ondestory() method, like shown below, solved the problem.

Code:.

So we either need to fix it on the framework side, so that when an activity is destroyed, all drawable objects associated with it are released as well, or we need to make sure that all static images are handled by all the applications in a proper way and all drawables are recycled explicitly.


Posted On: Sep 11 2009 . View Related Posts . . View 2 Replies .

Motorola Droid - Huge Dialer Memory Leak - Sms Inbox Full

I've got a serious problem with my droid. The dialer system app keeps having a memory leak up to 135mb, leaving me with a low memory warning and ~30mb free. It comes and goes and there is nothing i can do to force it to go away. Soon after the memory leak starts happening, i begin to get "sms inbox full, incoming message cannot be received" messages even if i clear my inbox. I used to keep hundreds and hundreds of texts but now it thinks it is full after a handful. On top of all that madness, during these spurts i am unable to download apps from the market, they just sit there forever trying to begin.

Whatever is causing this memory leak is making my phone almost unusable and my experience with android an absolute misery. For up to 5 hours at a time i have to go without the ability to receive sms messages or download applications. Any related info i can find through google searches always comes up short, people find and acknowledge the problem and never find a solution.

I have read that when unable to download apps to log in to google talk and that somehow fixes it, but my google talk app also appears not to work. It closes on opening. So i guess i'm just royally screwed.

I believe my options are a. ) Reinstall os 2. 1 or b. ) Go to verizon and get it swapped out.


Posted On: 05-06-2010, 08:40 PM . View Related Posts . . View 2 Replies .

Htc Incredible - Htc Mail Memory Leak Solution

I slowly watched the memory usage for htc mail creeping up and up. I was up to over 80 megs, and the performance of my incredible was notably getting worse. I was looking and looking, and although i found a lot of other people having problems with htc mail, i never found a solution to it other than a hard reset.

So i deleted my hotmail account (left the gmail account alone). Instantly down to 15 megs. Reinstalled the account, reloaded my mail. Still only at 15 megs. So if you're getting the "low on memory" error, try removing all your email accounts except gmail, then re-adding them. Worked for me.


Posted On: 07-15-2010, 10:29 AM . View Related Posts . . View 2 Replies .

Media - Move Ringtones From Internal To External Memory

Is there a way to transfer from internal memory the ringtones to external memory? I tried to day but it wouldnt let me either delete or move the default ringtones in the internal memory. I managed only to copy them to the external folder.

Posted On: 02-21-2010, 11:56 AM . View Related Posts . . View 3 Replies .

A Safer Way Of Using Soundpool

The presence of soundpool in the sdk causes a bit of a dilemma for those of us developing games. On the one hand, it's not a public api and it might go away or change in future releases, breaking our games and annoying our users. On the other hand, it does provide a noticeable performance improvement over using mediaplayers, and i have to assume that my competitors will be using it to eek out as much performance as possible. So after changing my mind a few times, i've decided that i will use soundpool in my game, but i've come up with a compromise that will hopefully stop it from breaking if the api changes later: attached is a set of classes that wrap soundpool by loading the class dynamically at runtime via reflection, and if it isn't found or doesn't support the expected methods, falls back on a wrapper around mediaplayer that implements a (very) small subset of the soundpool api. It's very basic and only supports playing non-looping sounds with variable volume, so it won't help if you need pitch changing, but if you just want soundpool for its performance then it might be useful.

Some caveats: as mentioned by others, if you try to play more than maxstreams sounds at the same time then soundpool will deadlock. It might still break if the api changes in the future without changing the method signatures (so the parameters have different meanings). If that causes an exception in soundpool then my wrapper will throw a runtimeexception up to you, so you could catch them if you'd prefer for sound to fail silently instead of crashing your app. Calling soundpool's methods via reflection involves a certain amount of overhead. In my tests the average call time was 3. 439ms, compared with 3. 088ms when calling soundpool directly, so an 11% overhead.


Posted On: Feb 16 2009 . View Related Posts . . View 5 Replies .

Soundpool Sounds Not Changing / Why Is So

I have a soundpool object and several sounds, but once created i can't change the sounds playback in anyway, such as number of loops, volume, stopping, etc.

Declaration code.

I know these functions are being called but nothing will cause it change in anyway. I've also tried setloop, setvolume, pause and unload, none of these worked either.


Posted On: Aug 29 at 18:07 . View Related Posts . . View 1 Replies .

Soundpool Doesn't Play Sounds

I am trying to use soundpool class from the new sdk. However, i discovered that if i load sounds that are >100k (120k and 350k) from resources i have problems playing them.consequently, the playback never starts. Curiously, the numbers in the message do not seem to change with sound files of different sizes: whether it is 120k or 350k, it always says "not enough memory for audiotrack size=1048640". Also, when i load the sounds i see numerous messages in the log saying "06-23 10:53:35. 743: error/audiocache(35): heap size overflow! Req size: 1052672, max size: 1048576".

So, is there any "official" size limit on the size of the files you can play, or are there any settings to adjust to solve this problem? The test application where i get this doesn't actually do anything else but loads and tries to play these sounds, so i do not think that it is the problem of it using too much memory overall. I also tried both . Ogg and . Mp3 files - equally without any success.


Posted On: Jun 23 2009 . View Related Posts . . View 2 Replies .

Possible Values That Can Be Passed To Soundpool Constructor For Srcquality Parameter

Can anyone fill me in as to the possible values that can be passed to the soundpool constructor for the srcquality parameter?

I see that it is an int, but no description is given in the documentation about what values are acceptable and what they even mean. I've seen examples that use 100 for this value and other examples that use 0.


Posted On: Feb 28 2009 . View Related Posts . . View 2 Replies .

Media - Sound Not Syncing After Conversion / Media Player For Wmv Video Files

Anyone know of a media player for wmv video files? I downloaded a video file (wmv) and converted it to mp4. The file played in the video player (froyo 2. 2), the only problem was the sound was delayed by 2 to 4 seconds behind the video.

Posted On: 09-04-2010, 03:08 AM . View Related Posts . . View 13 Replies .

Media - Media Gallery Fail To Open Image

Like the title says, when i try to set a different wallpaper or set a picture for a contact after i click on the desired image it says "failed to open image"

Posted On: 09-02-2010, 12:38 AM . View Related Posts . . View 2 Replies .

Media - Android Getting Rfid - Object-based Media

Ive read a recent post on this media player that uses physical objects to control media playback. It is based on radio frequency identification (rfid) that triggers various phone interactions when in the range of a wireless tag embedded inside a physical object.

Below is the cool video link:
Iphone rfid: object-based media


Posted On: 12-24-2009, 12:24 AM . View Related Posts . . View 1 Replies .

Why Do Beta Roms Leak?

I read many news about leaked beta roms for all kind of android phones. How can that even happen? Does google publish the beta to all kind of "developers" or are there some google employees who don't care about rules and just update.

Posted On: 2011-04-05 . View Related Posts . . View 1 Replies .

Htc Incredible - Kernel For New 2.2 Leak

I am new to rooting and rom flashing on android. I just installed the rom that is just a rooted version of the leak and i want to try a new kernel. It seems like either hydras or kings are the most popular are they both stable with the new leak? And can i back up the stock kernal or does a nandroid backup do that? I just want a kernel that will give me good battery life and at least the same performance.

Posted On: 08-27-2010, 10:55 AM . View Related Posts . . View 1 Replies .

Motorola Droid X - Possible To Root From 2.3.9 Leak

Is it possible to root from the 2. 3. 9 leak?

Posted On: 10-03-2010, 12:18 AM . View Related Posts . . View 3 Replies .

Htc Eris - 2.1 V3 Leak Root Program

I heard there was a program to root the 2. 1v3 leak. Anyone have a link to said program or maybe a link to an article about it?

Posted On: 07-18-2010, 06:22 PM . View Related Posts . . View 6 Replies .

Sprint Htc Hero - Goodies For The 2.1 Leak

If i flashed that 2. 1 leaked rom, can i download something else that adds friend stream and speech to text? Or do i have to flash a whole new rom?

Posted On: 05-09-2010, 01:35 PM . View Related Posts . . View 10 Replies .

Htc Incredible - Ota Leak To Frankenrom

What's the preferred order of steps to get from original ota leak (already installed) to frankenrom with new(er) radio and which radio version is recommended? I have never rooted before. Only saying that so anyone helping knows i have no experience with it, not that i am concerned about doing it.

Posted On: 08-20-2010, 08:56 AM . View Related Posts . . View 2 Replies .

Htc Incredible - Official Ota Leak

I have tried to download droid_inc_official_ota_froyo.zip from mejdam's youtube channel and it keeps failing at 120mb downloaded. I have tried all browsers and at work and home with no luck. Does anyone have a copy of this that they can post somewhere as a mirror?

Posted On: 09-21-2010, 03:59 PM . View Related Posts . . View 8 Replies .

Motorola Droid X - Changes From 2.2 Leak To Official 2.2 Ota

I have the original update.zip leak and am wondering if it would be worth it to switch back to 2. 1 and then go to official 2. 2.

Posted On: 09-22-2010, 03:18 AM . View Related Posts . . View 34 Replies .

Motorola Droid - Mod 2.1 Source Build Early Leak

Was idle in their #chan and caught wind of this. Droidmod_sholes-ota-eng.zip. Wififix.zip. Apply one after another, data wipe required.

Posted On: 04-18-2010, 05:52 AM . View Related Posts . . View 4 Replies .

Htc Droid Eris - Go Back To 1.5 After Installing Latest 2.1 Leak

Anyone know if you can go back to 1. 5 after installing the latest 2. 1 leak? I really like some of the new features of the leak but after i installed the leak i have experienced delayed dialing and contact funtions. I want my phone to preform better as a phone before an internet enabled device.

Posted On: 04-22-2010, 06:05 AM . View Related Posts . . View 11 Replies .