There is a fundamental problem in WPF that can cause a memory leak in applications using it. The problem is that a ColumnCollection in a Grid can become pinned in memory. It is not in all cases but in a specific case in the application I work on. I am not 100% about what in the structure caused it but there are 3 separate potential contributing culprits that I've identified. Without extensive testing of the different scenarios I won't be able to identify exactly what the cause was. The three potential contributing culprits are:
1. User control inside a DataTemplate with a Grid. It does not matter how deep in the control the grid was in the control all Grids were getting caught
2. Binding column widths from a parent grid to an inner grid through a border control. This was done to emulate a grid like behavior but allow for multiple control types within the grid
3. Binding and unbinding the collection view source every time the source of the observable collection changed.
In trying to fix this problem it seemed as if it was related to the DataTemplate but it is unclear exactly what caused the issue.
The actual leak came from the pinning of the Grid.ColumnCollection. The pinning of that caused all the associated control to be pinned as well. The Grid.RowCollection did not seem to have the same issue. This was still an issue even if there were no columns defined. It also occurred if a Grid was used inside a control from the same assembly. If the Grid was anywhere inside a user defined control in the same assembly, at any level, the issue would occur, even if it was in another user control. Crossing the assembly boundary appears to make this not occur.
To fix the issue I replaced the Grids in the affected controls. The grids were replaced with a combination of StackPanels and DockPanels which can be used to replicate the grid. In this case they were actually more appropriate than using a Grid anyway.
The lesson from this appears to be that the use of a Grid over other LayoutPanel types should be carefully considered. If memory leaks start to appear with the Grid it needs to be changed to another Layout type.
reebok pumps for sale
ReplyDeleteugg boots on sale 70% off
cheap polo shirts
air jordan 6
fendi outlet
coach factory outlet online store
gucci handbags
cheap converse shoes
abercrombie and fitch coupons
chanel handbags
michael kors outlet handbags
kobe shoes
puma outlet store
nike factory
burberry outlet
marc jacobs handbags
ralph lauren clearance
fitflop outlet
juicy couture
the north face clearance
jordan 6 infrared
ugg boots clearance
canada goose outlet
prada handbags
coach factory outlet online
kate spade handbags
nike air max 2015
burberry scarf sale
converse sale
girls jordans
christian louboutin outlet
hermes belt
celine outlet online
air max 2015
kobe shoes
air jordan 6
michael kors handbags
mbt shoes for women
ReplyDeletenorth face jackets clearance
michael kors handbags
michael kors outlet store
cheap jordans
north face women's jackets
gucci sunglasses
jordan 3
hollister clothing store
canada goose sale online
columbia outlet stores
north face kids jackets
ugg boots
michael kors factory outlet
nike online
converse outlet
coach factory online
nike discount
cheap salomon shoes
north face outlet
canada goose jackets
michael kors handbags clearance
prada shoes
burberry sale
toms outlet factory
christian louboutin outlet
abercrombie outlet online
coach bags
under armour outlet stores
north face jackets
nfl jerseys
under armour clearance
north face outlet
polo ralph lauren factory store
nike outlet
gucci outlet
michael kors sale
timberland boots outlet
ReplyDeleteadidas nmd uk
cartier love ring
nike air max 90
nmd adidas
oakley sunglasses
nhl jerseys wholesale
sac longchamp pliage
coach factory outlet online
under armour
versace sunglasses
louboutin shoes
the north face outlet
nike free runs
ralph lauren pas cher
prada handbags
yeezy boost 350
ghd hair dryer
louis vuitton bags
nike cortez white
oakley vault sunglasses
kate spade outlet online
omega speedmaster
coach factory outlet
nike free flyknit 5.0
north face jackets
ed hardy
michael kors uk
nike huarache black
michael kors outlet store
birkenstock outlet
coach outlet store
michael kors canada
skechers outlet
nike huarache
nike free flyknit 3.0
armani exchange
puma outlet
oakley sunglasses outlet
coach outlet online
chenzhen201671
chenlina20160725
ReplyDeletetoms shoes
coach factory outlet
louboutin pas cher
louis vuitton handbags
adidas originals
michael kors handbags
true religion outlet
hermes bag
cheap nfl jerseys
oakley sunglasses
kate spade outlet
michael kors handbags
michael kors outlet
celine handbags
replica watches
ralph lauren outlet
louis vuitton bags
coach factory outlet online
ralph lauren
coach outlet
nike free run
louis vuitton outlet
designer handbags
supra sneakers
coach factory outlet
fitflops sale clearance
mont blanc pens
cheap jordans
ray ban sunglasses
tory burch handbags
air max 90
coach outlet store online
kobe 11
jordan retro
adidas yeezy 350
longchamp bags
oakley outlet
adidas superstars
nike roshe flyknit
burberry outlet
as
chenlina20160725
ReplyDeletetoms shoes
coach factory outlet
louboutin pas cher
louis vuitton handbags
adidas originals
michael kors handbags
true religion outlet
hermes bag
cheap nfl jerseys
oakley sunglasses
kate spade outlet
michael kors handbags
michael kors outlet
celine handbags
replica watches
ralph lauren outlet
louis vuitton bags
coach factory outlet online
ralph lauren
coach outlet
nike free run
louis vuitton outlet
designer handbags
supra sneakers
coach factory outlet
fitflops sale clearance
mont blanc pens
cheap jordans
ray ban sunglasses
tory burch handbags
air max 90
coach outlet store online
kobe 11
jordan retro
adidas yeezy 350
longchamp bags
oakley outlet
adidas superstars
nike roshe flyknit
burberry outlet
as
ugg boots
ReplyDeletecheap jordans
rolex watches
coach outlet store
the north face outlet
canada goose jackets
gucci outlet
lebron james shoes 2016
nike free flyknit
polo ralph lauren outlet
20170217caiyan
ugg boots
ReplyDeletecheap jordans
rolex watches
coach outlet store
the north face outlet
canada goose jackets
gucci outlet
lebron james shoes 2016
nike free flyknit
polo ralph lauren outlet
20170217caiyan
longchamp outlet
ReplyDeletecoach outlet
ugg boots clearance
coach outlet
michael kors outlet
ugg boots clearance
coach outlet
canada goose outlet
cheap mlb jerseys
canada goose jackets
20171115caihuali