I am developing an application using WPF. I am using a lot of Grid layouts. In my application, we use five services to communicate. All works fine. Sometimes, the application slowed way down so I checked task manager to see the memory usage. Then I saw 1.285 GB memory occupied by the application process.
I am using Windows 7 operating system. My Application developed in wpf 4.0 version. In that we use WCF , WIF etc for communication. I also used Images. Can any one give the solution why application process occupies more memory?
All the images are small images.Actually my application occupies nearly 110 MB.But sometimes it occupies 1.238 GB memory.I am not using Large images in my application.
There's no magic bullet answer here for you, it really depends on what you are doing in your application.
Its time to jump into the world of using a profiler and figuring out what is going on in your own app.
Related
I would like to ask about memory leak with my C# application. I created an application for get and store data into database. My Application is communicate with another application (client for measurement) through the special DLL library (using WINAPI). The DLL library is working as an TCPInterface.
But, I have memory leak (Im sure, the problem is my application):
After longer time (few days of measurement 24h/day) I open task manager and:
physical memory in Windows task manager is full (after longer time with full memory, computer is working very slow or freeze),
My Application is using about 100MB of RAM (same like on the start and not increase),
Measurement application is using about 120MB of RAM (same, like on the start and not increase),
another processes in task manager are negligible.
And I dont know, where I lost about 4GB of RAM (when I compare list of running processes in Task Manager and Summary of available physical memory).
I tryed ProcessExplorer but without result.
Q1:
Is it possible, that some threads running inside my application are not calculated in memory information of my application in task manager?
Q2:
If the DLL using some physical memory and my application is calling the DLL through WINAPI, where will be counted the amount of used memory of this DLL?
- to my application? ...or where? -how can I see it?
THX for each help.
I need some help in Making a slideshow type application in WPF. Problem is, Image that needs to be used in this application are .gif, for which i think so we dont have any control in WPF.
Does any one have any idea of how to play those images without impacting any kind of performance? Also the machine in which i need to use this application is windows XP, that means the we can only use up to .net 4.0.
What I have tried:
I have tried many examples find over this page, but the memory it consumes is too high as i need to change image more often.
Dll's that i have tried are
wpfanimatedgif:- It has some serious memory leak issues.
also i have tried
XamlAnimatedGif:- it works fine while running on .net 4.5 machine. but was unable to display any image while on .net 4.0 machine.
I am developing a UWP-App which has a webview control on it.
Most of our code is JavaScript.
The app consumes tons of ram over the time and we have no clue where this memory leak comes from. The is almost no nativ code running, most of it is javascript, we cleared the DOM which is only about 5MB. The size of the app at this moment is about 300MB. I also tried to run the GC with almost no effect.
At start the app has a size of about 50MB, Increasing fast to about 100mb and then slowly consumes more and more RAM. I had a maximum of 1.8GB.
Does anyone has/had the same problem? Is it a equivalent leak than the webbrowser control had?
Update
The cause of the Problem is the growing cache of the WebView. Is there any chance to clear the cache, without closing the app?
As it seams, the problem wasn't the cache, but the Intel App Framework we use.
The Framework we use is an elder version (2.0) which doesn't release the references properly.
An update to version 3.0 solved the problem.
I have a WPF application developed on a Windows 7 - 32 bit desktop. The app runs fine in the development system. It also runs smoothly on Windows 8 32 & 64 bit desktops.
When I run the same application on a tablet with Windows 8 - 32 bit, the application UI responds very slowly and runs very slowly. This application is actually used to monitor data received over UDP.
The tablet I am using is an HP ElitePad 900 which has Intel Atom Z2760 / 1.8 GHz (Dual Core), 2GB RAM.
I don't think the hardware is what is causing the problem.
I tried setting the ProcessRenderingOption as
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
in the application startup. But still no change. I need some suggestions/answers as to what the problem maybe.
FYI the tablet has Windows 8 not RTM, so it allows desktop applications also to run.
If there is no difference when you set ProcessRenderMode = SoftwareOnly, it is helpful to investigate the cause of problem.
Situation 1
If your app uses effects that can't be handled by GPU,
it is always rendered by CPU regardless ProcessRenderMode setting.
Thus, ProcessRenderMode is implicitly set SoftwareOnly.
So when you set the setting SoftwareOnly explicitly, it has no effect.
In this case, your app's performance depends on CPU throughput.
ATOM may be poor than your desktop CPU, the result can be explained.
Situation 2
If your tablet's GPU has not enough to render WPF effects,
some effects are rendered by CPU. This causes performance down.
You can check WPF GPU capability with System.Windows.Media.RenderCapability class.
Conclusion
The cause is
CPU throughput because your app is always rendered by software. Or
poor GPU capability to render WPF rich effects.
Sometimes I create some quick personal projects using C# with Windows Forms or WPF. I have noticed that managed applications can take 2x or 3x times longer to start compared with native applications.
I have written a "Quick Notes" application, however it isn't very "quick". :-(
What are some techniques to speed up the initialization of Windows Forms/WPF applications?
Check out NGen
Also, if you are loading lots of data on load, move it to another thread and show an indicator or something (while it's loading) so at least the form pops up quickly, even if it takes a little longer for the actual data to load.
.NET 3.5 SP1 does tend to make start up a little quicker. Also see a series of blog posts on putting up a splash screen (in native C++) while starting the WPF application at the Logos Blog.
.NET 3.5 SP1 also now includes the ability to create a fast SplashScreen without using C++
You might also want to consider moving processing off to worker threads. When your app starts load the root UI, but not the data - rather load the data async (and create pad windows etc. as each data item comes in).
.NET applications made for .NET 3.0 or later work much better on newer versions of Windows, Windows Vista, Windows 7, etc. I think in a few years time the difference between managed and unmanaged code in terms of performance will unnoticeable.