Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi all,

I have created an application like interactive information application for public (full screen) in WPF Application using VB.Net. I'm using Page.xaml as my interface and display data/information from local MySQL.

I have a problem where the kiosk is running at high memory and increasing when public using without non-stop and slow on decreasing. I'm using a task manager to see the usage(Yes I know I should not look and benchmark from it but when the RAM is at maximum from task manager,the application will be hang. Just hang like that until I terminate it).

I have implement IDisposable, Finalize, SetProcessWorkingSetSize, dispose memorystream, dispose rdr(query), DecodePixelWidth and set BitmapScalingMode.LowQuality but still program will be hang after continuously use.

Any other way to overcome this? Will these approach can do better?
1) Using Window.xaml
2) Using Frame and call every page inside it
3) Use VirtualStackPanel
4) UserControl?

I also try running this application on VS2015 where it got DiagnosticTools to see the Process Memory. GC somehow hit and it achieve until 2GB for 2 minutes play and not decrease to even 1GB after let it idle for 5 minutes.

My development:-
- WPF Page
- .Net4ClientProfile
- VS2010
- Windows 8.1
- Intel i7
- 16GB RAM
- 2GB DDR5
- Any other else,kindly ask.

Kiosk:-
- Intel i5
- 4GB RAM
- Integrated HD Graphic

What I want to know actually is:-
1. What made my program not decrease memory
2. Is using Arraylist can cause this
3. Is animation and crowded design cause this(client's proposal)
4. Does query to MySQL can cause a problem
5. Does windows background process(services or invalid windows licensing)
6. Windows 8 not stable?
7. Using other than page?
8. Writing in VB.Net affect too?

What I have tried:

Implement IDisposable, Finalize, SetProcessWorkingSetSize, dispose memorystream, dispose rdr(query), DecodePixelWidth and set BitmapScalingMode.LowQuality
Posted
Updated 24-Mar-16 7:03am
Comments
CHill60 24-Mar-16 11:11am    
We can't answer any of these points without seeing your code.
Luiey Ichigo 24-Mar-16 21:39pm    
How to post a code?I can't post the code here as it might prolong this page. Any site to paste code?

We can't tell you what's causing the problem, other than it's your improperly written code that's doing it.

None of the items on your list are the culprit. It's coming down to something in your code that isn't properly managed.

You're not releasing objects somewhere and/or not Disposing of them properly.

You're not managing lists of objects properly, i.e., constantly adding things to a list but never removing them. You may think that you're using the same instance of an object over and over again but you may actually be creating a new instance of the object on every use.

There's a ton of possible causes so it's impossible to list them all here. What this really needs is a code review over your entire application to make sure you're doing things properly.
 
Share this answer
 
Comments
Luiey Ichigo 24-Mar-16 21:40pm    
Hi Dave, I have seen some information about creating same instance over and over in forum or blog if I'm not mistaken. Still I don't know where to start digging the cause.
Dave Kreskowiak 24-Mar-16 23:18pm    
That's why I said "code review". This is an examination of all of your code.

Your only other option is to get a memory profiler and profile your application. If you've got leaks in the code you'll have to analyze what you find and see what sticks out. For example, if you're doing a bunch of graphics stuff but the profiler is showing that you've got a large pile of Bitmap objects that haven't been disposed, and you know that you shouldn't have that many Bitmap objects alive in your code, you've got a hint at what to look for.

We can't do a code review for you. We all have our own work to do and you wouldn't learn much about how to diagnose the problem if we did.
Luiey Ichigo 26-Mar-16 11:11am    
Hi Dave,

I understand about not troubling people for solving my code. so thats why I post about some hint that I can do which is other programmer do to make their software running good on lower spec hardware especially eith IPC comes from China.

Never overcome this matter on previous 5 projects which using local assembly of well-known hardware and NUC. Not a single crash for 12hours running for since 2011
If you have many large objects (in terms of memory) that end up in the Large Object Heap your memory could become fragmented so that you can no longer allocate another large object, even though the total memory is sufficient.
See:
.net - Why Large Object Heap and why do we care? - Stack Overflow[^]
and
Search - CodeProject: "large object"[^]
 
Share this answer
 
Comments
Luiey Ichigo 24-Mar-16 21:49pm    
Hi Matt,

Somehow from task manager(again sorry for looking at it) like the image sample task manager image[^] the RAM Graph and of left panel is at Max but in word "In Use" like 900MB in image is just 2.5GB where graph is at 3.9GB and thats what make me weird

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900