Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

objective c - CGImage, NSArray and Memory -


this multiple part question, because ignorance on matter has multiple layers.

first, put caching system caching cgimageref objects. keep @ cgimageref level (rather uiimage) loading images in background threads. when image loaded put nsmutabledictionary. had bit of arm twisting cgimageref's array:

//bunch of stuff drawing context cgimageref imageref = cgbitmapcontextcreateimage(context);  cgcontextrelease(context);  [(id)imageref autorelease]; [self.cache setobject:(id)imageref forkey:@"somekey"]; 

so, can see, i'm trying treat image ref nsobject, setting autorelease placing in dictionary. expectation allow image cleaned after being removed dictionary. now, beginning have doubts.

my application clears cache array when user "restarts" play different images. running application in instruments shows memory not dropping "start" level on restart, instead remains steady. gut tells me when array has objects removed cgimageref not being cleared.

however, i'm unable confirm don't quite know how track down actual source of memory in instruments. it's list of (malloc 16 bytes, malloc 32 bytes, etc), drilling them show list of dyld callers. not sure how read it.

so, first question, way of caching cgimageref objects flawed? , there better way confirm such things in instruments?

first of all, caching cgimages ok , don't see problems code posted.

am correctly assuming use nsmutabledictionary cache? if so, can clear sending -removeallobjects, should release keys , values. if set different images same keys, memory usage may remain same because replace previous images new ones. if images have same size, memory usage should constant except brief spikes when create new batch of images.

as instruments, i've seen both report false positives , miss real leaks. try running several times, making pauses, if possible, leaks instrument "catch up". sounds crazy, think may make bit more reliable.

if else fails, can log contents of cache before , after loading set of images make sure cache works expected.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -