Tuesday 15 July 2014

c# - Memory consumption of WPF application in TaskManage -


I have created a WPF application, and my client asks me that memory consumption increases in each and every action. That he had checked in Task Manager. (Yes I have checked too).

I have tested any memory leak using anti, and I have failed. I have already approved the memory leak issue in my application (well know, memory leakage and memory consumption are different). But still the consumption increases in every memory, for example selecting an item in the list box

Here is the CS code I have used. Private Zero Button 1_Click (Object Sender, RoutedEventArgs e) {ListBoxItem item = (PinnedListBox.SelectedItem ListBoxItem); PinnedListBox.Items.Remove (item); UnPinnedListBox.Items.Add (item); } Private Zero Button 2_Click (Object Sender, RoutedEventArgs E) {ListBoxItem item1 = (UnpinnedListBox.SelectedItem ListBoxItem); UnPinnedListBox.Items.Remove (ITEM1); PinnedListBox.Items.Add (ITEM1); }

On clicking on the button 1, item unpinned with pinned items, and onClickOff Button 2, item transfer with unpin-to-pin

Someone has advised me about this.

Thanks in advance.

KSAM

WPF applications are relatively large amounts of memory compared to Winforms applications Use however, even when your app is running, the OS will give it memory because it is required by the app. At a certain time, your app will collect garbage and originally release the memory.

You can do a simple trick to reduce your app by releasing some memory.

Also see:

No comments:

Post a Comment