memory-management

How free memory immediately in iOS?

点点圈 提交于 2019-12-24 10:01:48
问题 When you do a release, you do not immediately remove the memory. I used this code and I can see the memory before and after the use of release and it do not change. Ok, it will be release after some time. But, what can I do for release all memory I can before start a library that will use a lot of memory? Or how can I immediately release memory? 回答1: Memory Management is a big thing in iOS but this tidbit of information helped me a lot during my development. "Each object has a "retain count"

How to control memory allocation of a third party library?

流过昼夜 提交于 2019-12-24 10:01:22
问题 I am developing a real-time application on a server with two NUMA nodes. Below is a simplified version of the system diagram (the OS is Ubuntu14.04): .-------------. .-------------. | Device 0 | | Device 1 | .-------------. .-------------. || || || || .-------------. .-------------. | PCIE slot 0 | | PCIE slot 1 | .-------------. .-------------. || || || || .-------------. QPI link .-------------. | CPU 0 |<-------->| CPU 1 | .-------------. .-------------. || || || || .-------------. .------

External vs Internal memory storage . What shall i use?

房东的猫 提交于 2019-12-24 09:58:29
问题 I'm using a LazyList version in order to load images . It uses external storage , what is not bad . But in order to not show that files to everyone with a filebrowser in hand , i have thought to use internal memory instead , the max amount of memory for that is (5mB). What should i do? Are there any other possibilities?‎ 回答1: AFAIK there are no limits on internal memory per application. But, it's true, that this memory usually runs low if users have lots of apps on device so you should not

Memory leak — setting variable in init?

China☆狼群 提交于 2019-12-24 09:51:45
问题 Memory management has me confused again -- In my .h file, I have: @property (nonatomic,retain) NSMutableDictionary *properties; In my .m, I have the following init method, which complains of a leak in Instruments on the self.properties line: - (id) init { self = [super init]; self.properties = [[NSMutableDictionary alloc] init]; return self; } It also complains of a leak if I don't use the accessor. Likewise, it leaks if I use this strategy: NSMutableDictionary *temp = [[NSMutableDictionary

How is memory allocated when you create a property of class?

我的梦境 提交于 2019-12-24 09:48:06
问题 I have the following class: public class A { public List<string> AList { get; set; } } Then I create object of a class: A objectA = new A(); objectA.AList = new List<string>() { "1", "2", "3" }; My question is how memory will be allocated in a heap? I mean will be objectA.AList allocated inside of objectA (image1) or as a separate object in a heap(image2) Image1: Image2: 回答1: The correct answer is : Image 3. I'm not going to draw this but your example leads to 5 objects on the Heap. Objects

what is the reason for high % time in GC? for our app pool in APM perfmonitor tool, we see it crossing 99% and staying their for hours [closed]

五迷三道 提交于 2019-12-24 09:09:53
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year . Does this mean memory leakage? The %Time in GC goes to 99% even when noone is using the application. Could you please help me why this %time in GC counter is strangely behaving. this could be a code issue? application is in Asp.net and uses services to call some methods. For disposing oracle

Objective-C: Allocation in one thread and release in other

拥有回忆 提交于 2019-12-24 09:09:51
问题 I am doing this in my Main Thread: CCAnimation *anim; //class variable [NSThread detachNewThreadSelector:@selector(loadAimation) toTarget:self withObject:nil]; In loadAimation: -(void) loadAnimation { NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init]; anim = [[CCAnimaton alloc] init]; [autoreleasepool drain]; } And in main thread I release it: [anim release]; Now I want to ask if this is fine regarding memory management. 回答1: It's possible to allocate an object in one

What is the source of the leaky object for this code?

▼魔方 西西 提交于 2019-12-24 08:59:48
问题 Anyone able to help re what is the source of the leaky object for this code: My application compiles without any ANALYZE issues. When I run PROFILER and look at Memory Leaks I see leaks appears. One of these leaks is in my WeekendEvent object. There are 3 Leaked Block row items in instruments per the below (I've noted in the code where these point to): Malloc +1 Retain +2 Release +1 Question - I assume this implies there is a release, however where would this leak be from. The segments of my

how to find and fix the cause of the crash

倾然丶 夕夏残阳落幕 提交于 2019-12-24 08:57:04
问题 I submited an app to the app store and it was rejected due to: "We found that your app crashed on iPhone 5 running iOS 6.1.2, which is not in compliance with the App Store Review Guidelines. Your app crashed when we: when the user taps to sign into the app, a crash is produced. This occurred when your app was used: On Wi-Fi On cellular network Your app may encounter this issue if it is using too much memory. To learn more about iOS memory usage and how to track memory usage and leaks, please

Java Garbage Collection and big objects

随声附和 提交于 2019-12-24 08:55:54
问题 I have rasters in my program of approximately 1500x500 pixels. Each pixel is represented with a float. I believe that means that 1500x500x4(bytes) = 3 million bytes or 3mb. They can be bigger than this. Does the Java Garbage Collector treat big objects differently than smaller ones? Do they skip into a higher generation automatically? 回答1: Larger objects can be placed straight into tenured space. The size of the individual objects is what matters e.g. float[1500][1500] is 1500 objects which