memory-management

Received memory warning

扶醉桌前 提交于 2020-01-03 09:08:15
问题 I am working on an app with xml parser, uiwebview, navigationcontroller, displaying a lot of images on the main controller, that remains in the memory throughout the whole life of the app. I store my data using core data. I tried to figure out the memory footprint of the application since I am getting the following warnings: Received memory warning. Level=1 app delegate received memory warning main controller received memory warning main controller received memory warning RSSItem received

Identifying if an address belongs to heap or stack or registers

雨燕双飞 提交于 2020-01-03 09:08:12
问题 I have a pointer available with me to a C/C++ variable. Is it possible to exactly make out which segment of the memory this variable belongs to ? If yes, how ? Note: I just have the address of this variable, no further information if the variable is local/global etc. 回答1: Find out whether your architecture has pointers to your heap or stack region. Usually there are some stackpointers or framepointers.. Then compare your actual address to those addresses and decide where they belong. 回答2: If

Monitoring the Memory Usage of Spark Jobs

点点圈 提交于 2020-01-03 08:26:30
问题 How can we get the overall memory used for a spark job. I am not able to get the exact parameter which we can refer to retrieve the same. Have referred to Spark UI but not sure of the field which we can refer. Also in Ganglia we have the following options: a)Memory Buffer b)Cache Memory c)Free Memory d)Shared Memory e)Free Swap Space Not able to get any option related to Memory Used. Does anyone have some idea regarding this. 回答1: If you persist your RDDs you can see how big they are in

R memory not released in Windows

空扰寡人 提交于 2020-01-03 07:18:27
问题 I am using RStudio in Windows 7 and I have a problem in releasing memory to the OS. Below is my code. In a for loop: I read data through an API call of the Census.gov website and I use the package acs to save them in a .csv file via the temporary object table . I remove the table (usual size: few MB), and I use the package pryr to check memory usage. According to the function mem_used() , after the removal of table , R always returns to a constant memory usage; instead according to Windows

Iphone — Confused about leaks within my NSOperation

自作多情 提交于 2020-01-03 05:56:13
问题 My app has an NSOperation class called ServerRequest that handles networking tasks. According to instruments, it is leaking like crazy. Additionally, instruments says the code that builds the request is leaking, even though that is not an NSOperation. But I have followed Apple's advice in terms of setting up an autorelease pool, so I don't understand what could be the matter. Can anyone help? A portion of my code is below: -(void) main { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]

How to make weak self in MRC?

安稳与你 提交于 2020-01-03 05:24:09
问题 Message *m = [msg retain]; dispatch_queue_t queue = _handle_queue; __block ProtocolDriver* blockSelf = self; dispatch_async(queue, ^{ if (blockSelf.protocol_delegate && [blockSelf.protocol_delegate respondsToSelector:@selector(onReceive:)]) { [blockSelf.protocol_delegate onReceive:m]; } }); I have a MRC objective-c file, which need run some code in block asynchronously. But I thought the blockself is not safe since it is not weak pointer, Should I change it to true weak pointer. @interface

UIView isn't released. Calling delegate with self, and using UIView commitAnimations adds retain count

蓝咒 提交于 2020-01-03 05:22:11
问题 I have a view that is added as a subview in a viewcontroller. The subview has delegates methods and the viewcontroller is assinged as its delegate. The subview has a animation and calls a delegate method when the animation is finished. The problem is that when the viewcontroller is removed from the view by the navigationcontroller the subview isn't deallocated. Probably because it's release count is >0. When the viewcontroller is removed from view before the subview animation finishes the

HEVC VIdeo Extensions keep taking memory until UWP app crashes

帅比萌擦擦* 提交于 2020-01-03 04:16:19
问题 I am using HEVC Video Extensions in order to decode video on my UWP video app. The problem is that the HEVC app takes so much memory during playback that I am unable to play large 4k files without crashing. If I use the HEVC hardware only I am able to have better use of memory but limited in 4k on it. I have tried HEVC Extension and tried to see if there is garbage cleanup I can do but have not been successful in lowering the memory Just setting my video like this: MediaSource ams_02 =

My program has a memory leak

冷暖自知 提交于 2020-01-03 03:04:22
问题 -(IBAction)play2; { CFBundleRef mainBundle = CFBundleGetMainBundle(); CFURLRef soundFileURLRef; soundFileURLRef =CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"Bear3", CFSTR ("wav"), NULL); UInt32 soundID; AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID); AudioServicesPlaySystemSound(soundID); } This is giving me an error: potential leak of an object allocated " CFBundleResourceURL returns a Core Foundation object with a +1 retain count 回答1: AudioServicesCreateSystemSoundID

Strange JRUN issue. JRUN eating up 50% of memory for every two hours

[亡魂溺海] 提交于 2020-01-03 03:01:14
问题 I have strange JRUN issue. I have installed ColdFusion 9.0 on Amazon EC2 instance and seems everything working good except JRUN eating up arround 50% of memory for particular timespan. For countinous two hours it take 50% of CPU usage and then next 45 min to an hour it work normally and again it take 50% for next two hours. I am not running any schedule file. Also I will appreciate if anyone guide me how we can know which request causing JRUN to eat memory. Thanks for suggestion MIKE, but it