memory-leaks

Parallel Processes in bash bitcoin monitor that records to sql leaking data?

こ雲淡風輕ζ 提交于 2019-12-24 21:10:00
问题 I wrote a bash program to monitor bitcoin mining devices, it worked fantastically running one set of loops per second until I got above 8 units being monitored. My solution was to integrate parallel processing which seems to have 'caused more problems than it fixed, what I seem to get now is that all my data will either be recorded from only a single unit or the program will error out because of the variables I'm recording showing up empty. first I'll post my original script with all personal

Android memory leaks understanding

点点圈 提交于 2019-12-24 21:09:02
问题 I am reading the book called "Effective Java" by Joshua Bloch and there is a piece of code which leads to memory leaks. public class Stack { private Object[] elements; private int size = 0; private static final int DEFAULT_INITIAL_CAPACITY = 16; public Stack() { elements = new Object[DEFAULT_INITIAL_CAPACITY]; } public void push(Object e) { ensureCapacity(); elements[size++] = e; } public Object pop() { if (size == 0) throw new EmptyStackException(); return elements[--size]; } /** * Ensure

OpenGL is leaking memory. Which object is not being released?

给你一囗甜甜゛ 提交于 2019-12-24 20:52:43
问题 I'm having problems with my OpenGL rendering. The RAM memory grows absurdly up to the point the entire system freezes. I've identified that if I comment the entire render function, no memory grows at all. Therefore the problem is that my OpenGL render function might be allocating memory for something and I'm not releasing it. Can you identify what is the problem? PS: the thing inside the if actually runs one single time, so the allocation of memory it does, occur only one time This is my

MPI_Gatherv memory problems (MPI+C)

感情迁移 提交于 2019-12-24 20:19:59
问题 As a continuation to my previous question, I have modified the code for variable number of kernels. However, the way Gatherv is implemented in my code seems to be unreliable. Once in 3-4 runs the end sequence in the collecting buffer ends up being corrupted, it seems like, due to the memory leakage. Sample code: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <mpi.h> int main (int argc, char *argv[]) { MPI_Init(&argc, &argv); int world_size,*sendarray; int rank, *rbuf=NULL

iAd UIImageView memory leak

与世无争的帅哥 提交于 2019-12-24 19:08:18
问题 Running my app on device using Instruments tells me that iAd is leaking on a UIImageView (namely the ad). Does anyone know what this is about and how to fix it? 回答1: Raise a bug report with Apple 回答2: You need to release iAd in viewDidUnload 来源: https://stackoverflow.com/questions/3332272/iad-uiimageview-memory-leak

Memory leaks destroying my application?

半世苍凉 提交于 2019-12-24 18:16:13
问题 I'm in big trouble now, my iPhone application keep terminating again and again due to memory leaks and I am unable to judge that where are those leaks . Tell me what step can I take in order to resolve this problem. Thanks 回答1: I think you're confusing terminology here. A memory leak is when you don't release an object after you're done with it. A leak won't directly cause a crash . Leaks can indirectly cause crashes if you run out of memory as a result of not releasing lots of objects.

std::set deleter in C++ is not working

会有一股神秘感。 提交于 2019-12-24 17:50:02
问题 Here I have defined my own deleter , but not sure why isn't working . Second is there any way of not using for_each loop and just defining deleter using it at the time of set declaration makes all objects get deleted automatically when the set object goes out of scope . #include <iostream> #include <memory> #include <string> #include <set> #include <algorithm> using namespace std; class A { int i; public: A(int pi):i(pi) {} int intake() const { return i; } void show() { cout<<i<<endl; } ~A()

Out of memory exception when not using all the memory/limits

一世执手 提交于 2019-12-24 17:15:57
问题 We have an issue here where we can have some OutOfMemoryException . We will check how we can reduce the memory usage, but my question is why I get it at this point . According to the Memory profiler, and the windows task manager, the application weights only 400MB. For what I understood(confirmed here), for 32bits applications, the limitation should be around 2GB. My computer has 16GB of ram, and there is plenty of ram available(more than 4GB). So why do I get this error now? My question is

Questions about compiling Python in debug mode

倾然丶 夕夏残阳落幕 提交于 2019-12-24 16:23:21
问题 I am using Ubuntu 12.04, Python 2.7.3. I am having a segmentation fault in a C extension I have co-written. It seems to come from a pointer that was not free'd properly. I then use valgrind to find memory leaks. According to that answer, I have to compile Python in debug mode to get a valgrind friendly version of Python and get rid of its irrelevant reports. How to compile Python in debug mode? Even though the answer I linked answers part of that question, it does not provide me enough

Memory leaks in Debug mode

余生长醉 提交于 2019-12-24 16:08:16
问题 Is there any reason for a program to leak when compiled in Debug mode and not in release? (Debug means debug informations, and compiler optimization disabled, Release means no debug info / full optimization) That's what it seems to do but I can't figure out why. Btw purify is not being helpful here 回答1: A lot of pointer type errors, including memory leaks, can seem to appear or disappear when switching between debug and release mode. A couple of reasons might be: Conditional code compiled in