memory-leaks

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

ERROR: Memory Leak, data formatters temporarily unavailable

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 08:56:00
问题 I am developing a quiz app. I take questions from a xml file, parse it and display random questions. These are stored in NSdictionary and NSMutableArray. Also the app plays background music and sound for clicking of buttons(AVAudioPlayer). and vibration( AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)) In one particular function if i try to release the temp variables that I use(I.E NSDictionary and NSMutableArray) the app crashes wen i reach that function for the second time. Hence if i

Would such assignment of image cause a memory leak?

做~自己de王妃 提交于 2019-12-24 08:23:45
问题 - (void)viewDidLoad { [super viewDidLoad]; landscape.image = [UIImage imageNamed:@"tenerife1.png"]; } I assign a new UIImage to the image property of an UIImageView object. I am not sure if that would result in a memory leak? 回答1: No, it should not. The old image should be automatically released when you set the new one, and the "imageNamed" method uses autorelease, so you should be OK there. 回答2: hey take into account imageNamed has serious memory issues as you loose control over its cache -

Releasing closures

狂风中的少年 提交于 2019-12-24 08:22:40
问题 On a nodemcu, I'm using a closure to send a file over a socket, like this: function sendfile(sock, name) local fd = file.open(name, "r") function sendchunk() local data = fd:read() if data then sock:send(data) else fd:close() sock:close() end end sock:on("sent", sendchunk) sendchunk() end After transferring a few files, the interpreter panics due to "not enough memory". I can imagine this may be due to closure still hanging around. It would be difficult for the garbage collector to determine

JQuery setInterval with append, increase memory

你离开我真会死。 提交于 2019-12-24 08:13:44
问题 Sorry for my bad English. I've created a chat system with jQuery and when i try to replace contents(like users online-offline or messages recived) it works perfectly but start to be more and more slowly, cause javascript start to take more and more the memory. $(document).ready(function(e) { data = '<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris

MPI_Gatherv: create and collect arrays of variable size (MPI+C)

╄→гoц情女王★ 提交于 2019-12-24 08:12:34
问题 I am new to MPI and I am trying to manage arrays of different size in parallel and then pass them to the main thread, unsuccessfully so far. I have learned that MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm) is the way to go in this case. Here is my sample code, which doesn't work because of memory issues (I think). #include <stdio.h> #include <stdlib.h> #include

ResourceManager Memory Leak?

老子叫甜甜 提交于 2019-12-24 08:11:45
问题 We got two CDH cluster with the same version(CDH-5.5.2-1.cdh5.5.2.p0.4), and both the ResourceManager of each cluster with the same configuration. One of the ResourceManager is running well, and its heap memory is stay in a constant value(e.g 800mb) as the time is going on. But the other one will throw OOM exception and exit after 15 days. When we use 'jmap -F -histo' to dump its jvm heap info, we are seeing that the size of object 'char[]' is growing up as the time is moving, and it finally

IOService leaking for NO reason

送分小仙女□ 提交于 2019-12-24 07:38:10
问题 Okay, I am completely stumped and frustrated. I was working on an I/O Kit RAM Disk implementation and discovered that it wasn't unloading when my friend loaded it with kextload and then tried to unload it with kextunload . The reason for this was that none of the OSObject s which the kext allocated were being freed. However, on both my computer (running Mac OS 10.8.5) and a VM (running Mac OS 10.7) everything worked as expected. Eventually, I narrowed the problem down so much that I created a

detecting memory leak in C

巧了我就是萌 提交于 2019-12-24 07:29:00
问题 I know this is hardly a new question, but I haven't found anything elsewhere that works. I've got a C program that steadily eats memory as it runs - I use the 'free' command to track it, and I can see the amount of available memory is decreasing as long as it executes, which shouldn't be happening. However, I can't find anything in the program itself that could be causing this. I've also tested it with valgrind and dmalloc, and nether of them are able to detect any memory loss. How do I find

calloc: 4 bytes in 1 blocks are definitely lost

为君一笑 提交于 2019-12-24 07:26:23
问题 The following message gets generated after running my program under valgrind: 4 bytes in 1 blocks are definitely lost in loss record 1 of 11 ==21938== at 0x4C2DD10: calloc (vg_replace_malloc.c:623) ==21938== by 0x401636: main (syntax.c:187) That's the line of code where the leak was detected: char *word = calloc(4, sizeof(char)); //syntax.c:187 I'm not understanding what's wrong with the code above. Why is valgrind generating an error? 来源: https://stackoverflow.com/questions/43967592/calloc-4