memory-management

SKShapeNode has unbounded memory growth

与世无争的帅哥 提交于 2020-01-13 09:58:08
问题 If I run this code in a SKScene sublass init method for (int i = 0; i < 100; i++) { SKShapeNode *shape = [SKShapeNode node]; shape.antialiased = NO; CGMutablePathRef path = CGPathCreateMutable(); CGPathAddEllipseInRect(path, NULL, CGRectMake(arc4random()%320, arc4random()%320, 10, 10)); shape.path = path; [shape setStrokeColor:[UIColor blackColor]]; CGPathRelease(path); [self addChild:shape]; [shape removeFromParent]; } and everytime I run this code in my SKView controlling controller SKView

SKShapeNode has unbounded memory growth

女生的网名这么多〃 提交于 2020-01-13 09:58:03
问题 If I run this code in a SKScene sublass init method for (int i = 0; i < 100; i++) { SKShapeNode *shape = [SKShapeNode node]; shape.antialiased = NO; CGMutablePathRef path = CGPathCreateMutable(); CGPathAddEllipseInRect(path, NULL, CGRectMake(arc4random()%320, arc4random()%320, 10, 10)); shape.path = path; [shape setStrokeColor:[UIColor blackColor]]; CGPathRelease(path); [self addChild:shape]; [shape removeFromParent]; } and everytime I run this code in my SKView controlling controller SKView

Why are all my bitmaps upsampled 200%?

主宰稳场 提交于 2020-01-13 09:51:28
问题 I'm having severe memory issues in my application [1]. In order to investigate this, I took heapdumps of my app at different states. I saw that some bitmaps were taking huge amounts of memory. I wrote a small tool [2] that decodes the byte arrays to Windows bitmap files (.bmp), so that I can see the bitmaps and compare them to the files I have in my res/drawable folder. What I discovered is that all my files are upsampled twice. I first checked with the biggest one had: a byte array buffer of

“Memory Fragmentation” is it still an issue? [closed]

三世轮回 提交于 2020-01-13 09:35:10
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I'm a little bit confused. In the OS course we were told that all OSes take care of memory fragmentation by paging or segmentation and there is no contiguous physical memory allocation at all. OS uses different levels of addressing (logical/physical) to avoid the contiguous memory

List<object> memory overhead

落爺英雄遲暮 提交于 2020-01-13 08:31:05
问题 I have something like this: List<object> res = new List<object>(); ... while (...) { byte[] val = //get new byte[4] res.Add(val); //if this is commented memory usage goes from 2Gb to 180Mb } return res; Now val is always byte[4] and there are around 37000000 elements. So I would think that res should be around 37*10^6 * 4 bytes = 148 MB, but the real memory usage is around 2GB. If I comment res.Add(val); then memory usage is somewhere 100 MB. So where does the memory go to? EDIT I've tried to

Do object references take up extra memory?

ぃ、小莉子 提交于 2020-01-13 07:27:07
问题 Lets say you have the following complex object: var object1 = .... // (something complexed) This takes up x amount of memory in your JS application. Now lets say you have some other objects that reference object1 : var otherObject = { something: true, value: 'yes', object: object1 }; var anotherObject = { color: '#FFF', object: object1 }; Have I tripled the amount of memory that object1 originally took up? Or do the references to object1 not add to the overhead of the memory used? I'm not

Best way to provide the fingerprint comparison in the server side

南笙酒味 提交于 2020-01-13 06:48:06
问题 I'm going to provide the fingerprint authentication from server side via WebAPI. The below code is the fingerprint comparison part. var allFingerprints = container.Fingerprints.OrderByDescending(p=>p.FingerprintID); List<Fmd> fmdList = new List<Fmd>(); foreach (var fp in allFingerprints) { fmdList.Add(Fmd.DeserializeXml(fp.FMD)); } IdentifyResult identifyResult = Comparison.Identify(customerFmd, 0, fmdList, thresholdScore, 2); If the small amount(<3000) fingerprints are in the DB, I think it

Store pointer value

允我心安 提交于 2020-01-13 04:16:04
问题 As I know, when a pointer is passed into a function, it becomes merely a copy of the real pointer. Now, I want the real pointer to be changed without having to return a pointer from a function. For example: int *ptr; void allocateMemory(int *pointer) { pointer = malloc(sizeof(int)); } allocateMemory(ptr); Another thing, which is, how can I allocate memory to 2 or more dimensional arrays? Not by subscript, but by pointer arithmetic. Is this: int array[2][3]; array[2][1] = 10; the same as: int

Confused with Java Memory Management (Stacks and Heaps)

随声附和 提交于 2020-01-13 04:15:38
问题 This might sound stupid but I am still not clear about the Java Stack and the memory heap. What I know from studying is following: 1) All the method calls goes on stack. 2) All the memory allocated locally goes on memory heap (not very clear about this point) 3) All the memory allocated by new operator (either in a method or in a class) goes on memory heap. I am worried about the below cases: 1) If I create a int variable in a method and return it, where does it go ( I believe it goes on

Confused with Java Memory Management (Stacks and Heaps)

。_饼干妹妹 提交于 2020-01-13 04:15:14
问题 This might sound stupid but I am still not clear about the Java Stack and the memory heap. What I know from studying is following: 1) All the method calls goes on stack. 2) All the memory allocated locally goes on memory heap (not very clear about this point) 3) All the memory allocated by new operator (either in a method or in a class) goes on memory heap. I am worried about the below cases: 1) If I create a int variable in a method and return it, where does it go ( I believe it goes on