I'm working on an app using SharpDX to render DirectX content to a DrawingSurfaceBackgroundGrid in Windows Phone 8.
I've found that, if the app goes out to the photo picker or suspends/resumes through Fast Application Resume, memory utilization will increase by about ~2mb and prior resources will not be reclaimed. This means a DirectX-based app using DrawingSurfaceBackgroundGrid will eventually run out of memory on user-initiated actions.
The leak starts once DrawingSurfaceBackgroundGrid.SetBackgroundContentProvider is invoked with a SurfaceBackgroundContentProvider. I'm using a DrawingSurfaceBackgroundContentProviderNativeBase implementation that has empty method bodies for all abstract members.
An isolated repro can be found here. Repro steps are: build and run the app, click "choose photo", hit the hardware back button, observe memory spike.
Anyone else seeing similar?
This was a bug in SharpDX, which has been resolved in this commit.
Related
I am developing a hybrid application. My application is having a locator module that loads Google maps and drops the pins at some particular location. I am using a geolocation javascript file (Cordova) and phonegap location plugins to load the map.
But when I run my application on a device with iOS7 version, the app crashes after some time. When I connected the device and checked the crash logs, I came to know that it was due to increased memory usage after a certain time (while using the google maps module).
I want to know if I can increase the limit of memory usage by my application as it gets crashed when its memory usage goes high. Also, as this is a hybrid app so need to check if this can be done through native.
Heyy... the problem is solved. Posting the answer to my own question so that others may also implement it if they ever come across such issue.
.
I cleared the application caches in "didReceiveMemoryWarning" method of my view controller and custom plugins and set the properties and variables to NIL in "onMemoryWarning" method of CDVPlugin class. And this approach did the work for me. I am not getting any crash as of now.
Hope this helps the programmers facing similar issue !!!!
My app is like a tweet feed reader. But with use, the app's responsiveness slows down in the wp8 emulator. By being unresponsive, I mean the progress bar indicator speed slows down, no links respond, none of the app buttons respond and the app suddenly closes.
I think it is a memory issue with the emulator. Am I right? I can't test it as I don't have a device yet.
Even on increasing the memory using the Hyper-V settings I didn't observe much difference.
I have an in-app browser which works fine for the first 2-3 links but then makes the app hang!
This doesn't sound like a memory leak. What you're describing is a slow-down which is caused by putting too much work on the UI thread. Overall you should offload as much work as possible to a background thread or the compositor thread.
The app suddenly closes sounds like some unhandled exception, but it's hard to tell which one. You said the app works fine on WP7. Have you looked at known app compatability issues that occur once WP7 apps are upgraded to WP8? Check it out on MSDN # http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206947(v=vs.105).aspx
This really isn't enough to go on. Is there something printed out in the output window once the app crashes? Can you tell what's the last managed method to be invoked before the app crashes? Can you try profiling the app for CPU and see what's the method that's most invoked? And profile for memory usage and see how's memory consumption right before the crash?
I am developing a phonegap app using HTML, CSS, jquery in Blackberry and in this app, sometimes when I relaunch the app, I am getting memory alert and app gets quit. I have placed all images that I am using in a folder. How can I handle the memory issues?
Even I am facing a similar issue of device memory low in my HTML5+Phonegap BB app.
I face this problem often in BB 6.0 device but in BB 7.0(9900) I haven't ran into this problem yet.
On page 24 of the link posted by tennesha the BB memory architecture is briefly explained by tneil . I quote
"The amount of physically allocated memory varies between device models, but lets say on average it's approximately 40MB of RAM. This amount of memory is allocated for both running WebKit (loading the engine into memory, running JavaScript, displaying pages, computing layout, scaling images, etc.) and also loading your content in the view.
All apps on the device share the same WebKit instance so everyone shares the same 40MB space. Think of each app using a web view as creating a "virtual tab" in the same web kit instance."
Here's the link for your reference.hope this helps.
http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Device-memory-is-Low-issue-for-an-WebWork-app/td-p/1166441/page/24
Hope they solve this issue at the earliest.
Blackberry has a memory leak issue that is not resolved as yet. I use to develop apps for blackbery using html 5 but pretty much gave up. The platform has too many issues and is not ready for html5 app develpment. You can follow this link and see if there is any thing useful you can garner from it: http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Device-memory-is-Low-issue-for-an-WebWork-app/td-p/1166441 . Oh and by the way dont expect to get much real help from blackberry with this.
What does event OnSuspending in App.xaml.cs mean? I suppose this event is fired when we change Metro to Desktop or change metro application but what is done with app memory? Is it freed, saved somewhere or it is kept until OS exhausted memory? What steps I have to do as a programmer to keep application working after resuming? What do I need to save?
From your applications point of view, the suspend is somewhat like the 'pause' option of the debugger. Execution is completely stopped and the OS has the option to either resume the app at a later point or shut it down for good.
In the first scenario, your app will not have a clue about the meantime. In case it is shut down by the OS, on the next start the previous execution state will be set to 'terminated' so you should restore the app as it was when you received the 'suspend' event.
I have found a problem with the MFC CHtmlView class in an MDI app. Repeatedly opening and closing windows causes a progressive drain on memory. I’ve researched the problem and found the MSDN article about the BSTR problem (http://support.microsoft.com/kb/241750), implemented those fixes, but there is still a large drain occurring.
I’ve identified the problem in both VC8 and VC9, have tried to assure that all interfaces are truly being released, but am totally stumped.
The easiest way to see this is to use the MFC AppWizard (vc8 or vc9) to create a standard MDI app, only change the default CView to a CHtmlView. Compile and run the app in debug, and the app will automatically open a new html window to MSDN.
Open the TaskManager to follow the memory used by the app. Close the open window. Then each time you reopen and close a new window you’ll see a definite increase in the memory being held by the app. Once the app is closed though it show no leaks.
If anyone has any information, I'd appreciate hearing from you.
You can use SetProcessWorkingSetSize(pi.hProcess, (SIZE_T)-1, (SIZE_T)-1)) to minimize process working set.
http://msdn.microsoft.com/en-us/library/ms686234(VS.85).aspx
http://social.msdn.microsoft.com/Forums/en-US/ieextensiondevelopment/thread/88c21427-e765-46e8-833d-6021ef79e0c8