FAQ Database Discussion Community


PHP 5.5.6 Random memory leak

php,apache,pdo,memory-leaks,freetds
after we have migrated to PHP 5.5.6 and Apache 2.4 from PHP 5.3.3 every site that runs on Kohana 3.3 encounters from time to time a Out of memory exception. Full error message PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 140316914598360 bytes) in Unknown...

Single Page App - memory leak explanation

javascript,jquery,memory-leaks
So, I'm studying about SPA, and I know there's a lot of FrameWorks to help building one. But let's suppose here that I'm doing only using jQuery. Ok, so in one page, I create a table displaying user contacts, from an Ajax call: getContacts('', function(contactsObj) { contactsObj.forEach(function(contact) { $('#contactList >...

Retain cycle with parent-child construction

ios,objective-c,memory-management,memory-leaks,retaincount
Its very common question everybody familiar with, but I'm still not understand it fully. If Object A owns (have a strong property of) Object B, and Object B have a strong property of object A, there is retain cycle, and no object can be released and there is a memory...

Creating an instance from assembly throws a memory leak

.net,reflection,memory-leaks
I have a desktop application where i need to load some dll using reflection in a different AppDomain, call a method and unload the AppDomain. I have correctly developed it, however the number of assemblies i need to load and unload has been increased recently, and now, after loading 3...

Objective-C memory leak when returning NSString

ios,objective-c,iphone,memory-management,memory-leaks
I want to be sure that my code is not leaking, since this small snippet is called thousand times in my app. I run the app through Instruments and the initWithBytes seems to be problematic. Is anything wrong in this code? First [reader readString] is called. case FirstCase: { NSString...

Does under-utilized memory cause memory leak?

c,memory-leaks,strncpy
Does strncpy() leads to memory leak when we're copying less number of data to a larger (compile-time allocated) buffer? In other words, can the under-utilization of memory be termed as memory leak? Below is my code #define uk "ln" int main() { char buffer[32]; strncpy(buffer,uk,sizeof(buffer));// IS it memory leak free?...

Android bitmap processing - no leak but still OOM?

android,memory-leaks,bitmap
I'm writing a camera app and when I take a picture, I receive a byte [], decode it into a Bitmap and rotate it before saving it to JPEG. I'm rotating the photo using a native library, however the bitmap is still decoded from a byte[] into memory for this...

Valgrind and misuse of new[]?

c++,memory-leaks,valgrind
Valgrind is throwing a bunch of errors concerning the new[] operator in my program. I condensed it to a smaller example below #include <iostream> #include <fstream> #include <iomanip> #include <cmath> #include <ctime> #include <cstdlib> #include <omp.h> int num_spline_pts = 90; double *initialize_TriSol_a(); double *initialize_TriSol_b(); int main(int argc, char **argv) {...

Reference initialization in C++ when private unique_ptr is involved in class definition

c++,memory-management,memory-leaks
How the compile error below can be explained? #include <iostream> #include <memory> #include <vector> using namespace std; class A{ unique_ptr<vector<short>> v; public: A(){ v = unique_ptr<vector<short>>(new vector<short>()); cout << "A()" << endl; } A(const A& a) : A(){ cout << "A(const A& a)" << endl; } }; int main() {...

Getting Memory leak on android fragment

android,gridview,android-fragments,memory-leaks,android-arrayadapter
I've been searching for a solution of the "memory leaks" problem on my android app, but, here is the thing: I'm loading a fragment inside a viewpager, this fragment have a Gridview and an Adapter (ArrayAdapter) which creates each item of the gridview, these items have an image and some...

How to find the dll which causes a memory leak and not directly referenced by application

c#,wpf,dll,memory-leaks,msvcrt
I am writing a WPF application which uses a number of unmanaged DLL's. Something in the program is causing memory leak and I monitored the application using Redgate ANTS 8 Memory Profiler. ANTS shows that the memory usage of MSVCR110.dll is constantly increasing. The question is that can managed code...

Android: int array set null but still in memory after GC

android,memory-leaks,bitmap
I tried to break it down to the main code regarding the pix array: public class BitmapProcessor { int[] pix; public Bitmap run(Bitmap b) { pix = new int[picw * pich]; bitmap.getPixels(pix, 0, picw, 0, 0, picw, pich); // do some stuff bm = Bitmap.createBitmap(picw, pich, Bitmap.Config.ARGB_8888); bm.setPixels(pix, 0, picw,...

Singleton: is there a memory leak?

c++,memory-leaks,singleton
This is a simple singleton: class Singleton { Singleton(); virtual ~Singleton(); Singleton * Singleton::getInstance() { static Singleton * instance; if (!instance) { instance = new Singleton(); }; return instance; }; } When main code calls Singleton::getInstance()->someMethod() for the first time, isn't the class instantiated twice? Will be there memory leak?...

How to interpret Valgrind output

c++,memory-leaks,valgrind
Valgrind yields the following message block: 1,065,024 bytes in 66,564 blocks are definitely lost in loss record 21 of 27 at 0x4C2B800: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x40CA21: compute(Parameters&, Array<double>&) [clone .constprop.71] (array.hpp:135) by 0x403E70: main (main.cpp:374) How to read this message? main.cpp line 374 reads: results[index] = compute(parameters,...

How to measure memory consumption of DXL script?

memory-leaks,dxl
Finding out if your script has a significant memory leak might be of interest even before you run into serious trouble. Unfortunately, I was not able to find out how to measure the current stack/heap size or "string table" size (see http://www.smartdxl.com/content/?p=481). Can anybody help? Related question: Predicting DXL Memory...

A resource was acquired at attached stack trace but never released. memory leak

java,android,memory-leaks,android-ndk,jni
If I comment out the method (*a)->CallVoidMethod(a, b, meth, "FROM JNI"); The app doesn't crash else it crashes. Assuming that I haven't released the resource "jstr" which might have caused a memory leak then why does it happen only when CallVoidMethod() ? What should I do to solve this issue?...

SDL2 C++ - SDL_FreeSurface does not remove the image from RAM

c++,memory-leaks
I have a problem with memory leak. RAM usage in my application does not decrease after SDL_FreeSurface function. Code: //10 000 KB RAM SDL_Surface * surface = SDL_CreateRGBSurface(NULL,32000,5400,1,0,0,0,0); //700 000 KB RAM SDL_FreeSurface(surface); //700 000 KB RAM Why RAM usage does not decrease? free(surface); delete surface; surface->pixels=NULL; also they do...

Memory Leak on AppCompatActivity using LeakCanary

android,memory-leaks,leakcanary
I use LeakCanary and unfortunately got a leak and here is the logcat: 05-10 18:13:00.377 9098-9965/com.ponnex.justdrive D/LeakCanary﹕ In com.ponnex.justdrive:1.0:1. * com.ponnex.justdrive.DebuggingActivity has leaked: * GC ROOT static android.support.v4.content.LocalBroadcastManager.mInstance * references android.support.v4.content.LocalBroadcastManager.mReceivers * references java.util.HashMap.table * references array java.util.HashMap$HashMapEntry[].[51] * references java.util.HashMap$HashMapEntry.key * references...

No warning on deleting a forward declared pointer (Visual Studio)

c++,visual-studio-2012,memory-leaks,forward-declaration
Deleting forward declared pointers leads to undefined behavior. Examples: https://gist.github.com/jatinganhotra/4144778 http://stackoverflow.com/a/14382111/399908 However, my Visual Studio (VS2012) compiler doesn't warn me about it. Is this an unfixed VS2012 compiler bug? Did I disable (or never enable) the corresponding warning? Is this specific to some project setting? Visual Leak Detector hinted me...

Is following scenario a memory-leak in java?

java,android,memory-leaks
Here are 2 diffrent ways of doing the same thing (i.e Fetching messages from Database) Scenerio 1 Calling Class: ArrayList<String> messages = new ArrayList<String>(); messages = Db.getAllMessage(messages); Database Class: public ArrayList<String> getAllMessage(ArrayList<String> m) { m= /* get messages from DB */ return m; } Scenerio 2 Calling Class: ArrayList<String> messages...

Multipart form uploads + memory leaks in golang?

memory-management,memory-leaks,go
The following server code: package main import ( "fmt" "net/http" ) func handler(w http.ResponseWriter, r *http.Request) { file, _, err := r.FormFile("file") if err != nil { fmt.Fprintln(w, err) return } defer file.Close() return } func main() { http.ListenAndServe(":8081", http.HandlerFunc(handler)) } being run and then calling it with: curl -i...

What are memory leaks in C?

c,memory-leaks
I tried solving the extra credit of exercise 16, Eventhough it compiles properly, I get memory leaks. Now I was of the notion that if dont use malloc at all there is no way the program would leak memory, but here it does, because when I ran the command: valgrind...

Possible Memory Leak with prepared statements?

php,sql,memory-management,memory-leaks,prepared-statement
Background: I am trying to learn prepared statements, and this one is throwing an error I would like to learn how to fix. The data in the Item table is inputted by users which is why I am using a prepared statement for this one as well, and well... the...

WebSphere 7 - Can excessive Garbage Collection lead to out of memory?

java,memory-leaks,garbage-collection,websphere
Issue: Getting out of native memory exception and was wondering if excessive garbage collection can lead to this? Also any advice on GC policy or tuning would be helpful. I'm not sure if what I have warrants a change yet. Good Reference StackOverflow Question: Which GC Policy to Use Specs:...

Potential causes of memory leaks in Android

java,android,memory-leaks,garbage-collection
I'm using leakcanery to find memory leaks in Android. I found and fixed all Activity leaks. (surprised to know there were so many BTW!). I also added watch refWatcher for all my Fragments. Question 1: Is there anything else that I should watch that may cause noticeable memory leak? Question...

How to read the memory snapshot in Visual Studio

c#,visual-studio,memory-leaks
I use Visual Studio to take memory snapshot of my application. I have some questions about understanding the data I got. I after I capture the memory snapshot, I filter out one of my class, say MyClassPanel. I only use MyClassPanel in my xmal files. why ‘Paths to Root’ for...

Unity c# List memory leak

c#,list,memory-leaks,unity3d
I'm getting a serious memory leak when assigning textures at runtime. When useNewArray is true, Task manager shows that Unity's memory usage grows by ~20 MBs / second. The full (183k zipped) project can be downloaded here: https://goo.gl/axFJDs Here's my code: using UnityEngine; using System.Collections; using System.Collections.Generic; public class testMemory...

JSF mysql tomcat memory leak

java,mysql,tomcat,memory-leaks
I am a basic programmer and I meet a bug what I didn't see before. I use MySQL, Tomcat 8 and jsf. Here is my application (part): When I write something to the text area and hit the "Mehet" button, it makes the following: (xhtml page) <p:commandButton value="Mehet" action="#{alvallalkozoBevitelBean.add()}" update="@form...

C++ Templates specialisation char* and Valgrind

c++,templates,memory-leaks,char,valgrind
I've got a huge problem with memory leaks in my program. I use Valgrind to check memory leaks and with some changes I got about ~20 errors or ~40 errors, but still I can't eliminate all and don't know how. And I can't change the code in main function, I...

how can i find which application is causing memory leaks

java,tomcat,memory-leaks,heap
I am running Tomcat-6.0.32 on the RHEL 5.4 with JDK-1.6.0_23 version. I am running almost more than 15 applications. Applications are small applications only. My RAM is 8GB and swap is 12GB. I set the heap size from 512Mb to 4GB. The issue is after a few hours or days...

memory leak vs. access violation, class design issue

delphi,memory-leaks
I show a short design pattern for a user class in the code below. type MytestClass = class alist: TStringlist; public constructor Create; destructor destroy; override; end; { MytestClass } type TForm1 = class(TForm) btn_version01: TBitBtn; btnversion02: TBitBtn; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormCreate(Sender: TObject); procedure btn_version01Click(Sender: TObject);...

What is “allocation context”?

c++,c,memory-leaks,allocation
I'm a student and I have to do a research about memory leak detection. In many papers they are talking about allocation context. I don't know what it means. I can't find any definition of allocation context (or translation, I'm from Germany). As an example, a quote from a paper...

Square LeakCanary Cannot find symbol

android,memory,memory-leaks,square,leakcanary
build.gradle has been configured as per github insturctions.LeakCanary class doesn't seem to be included. dependencies { debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3' releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3' } analyzer and watcher packages has just 1 single class file in it....

why does “[[UIDevice currentDevice] identifierForVendor]”cause memory leak?

ios,memory-leaks
I am using x-code 6.3 instruments to analyze my application, but I don't understand why this line cause memory leak: + (NSString*)IDFV { NSUUID* device_id = [[UIDevice currentDevice] identifierForVendor];// !100% return [device_id UUIDString]; } I wanted to post a picture but not enough reputations. iI chose instruments-leaks-call tree,and select 'invert...

iOS - CGImageRef Potential Leak

ios,memory-leaks,cgimageref
I have this code: CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], rect); UIImage *outputimage = [UIImage imageWithCGImage:imageRef scale:image.scale orientation:UIImageOrientationUp]; and I get the warning: Object leaked: object allocated and stored into 'imageRef' is not referenced later in this execution path and has a retain count of +1 But I am using ARC...

How to free memory in C# that is allocated in C++

c#,c++,memory-management,dll,memory-leaks
I have a C++ dll which is reading video frames from a camera. These frames get allocated in the DLL returned via pointer to the caller (a C# program). When C# is done with a particular frame of video, it needs to clean it up. The DLL interface and memory...

What happens if you call a destructor and use the allocated memory again for other objects?

c++,pointers,memory-leaks
class base { virtual ~base(); }; class der1 :public base { int i; } class der2 :public base //I used double that der2 is bigger than der1 { double d; } int main() { base* ptr = new der2; ptr->~base(); //Destructor call just for the //case that the der2 had...

URLClassLoader Memory Leak Java

java,memory-management,memory-leaks,urlclassloader
I have been going through a lot of URLClassLoader Memory leak solutions on the internet, but I haven't found any fully working code and precise solution. The closest to a solution I found was this Any fully functional code or link to it, which uses WeakHashMap() or any other definite...

iOS Memory Leak after advanceToNextInputMode in Keyboard Extension

ios,memory,memory-leaks,ios-keyboard-extension
I'm developing Keyboard Extension on iOS 8.3 While developing there is a memory leak somewhere after calling advanceToNextInputMode. And the Responsible Frame and leaked Object are looks like totally out of my control. Can anybody meet anything similar problem? ...

OmniFaces UnmappedResourceHandler seems to leak resources when composite components are used

jsf-2,memory-leaks,composite-component,omnifaces,unmappedresourcehandler
It seems UnmappedResourceHandler is loading composite components xhtml files within the resources folder. The result seems a gradually increasing memory leak. The leak can be found within FaceletViewHandlingStrategy.metadataCache. It relies on a hashmap and when above handler is used UnmappedResources are used as the key for CompositeComponentBeanInfo instances. If the...

Why the private package String constructor (int, int, char[]) has been removed? [duplicate]

java,string,memory-leaks
This question already has an answer here: Java 7 String - substring complexity 5 answers In Java 6, there was a package private constructor to return a new String with the offset being changed. 643 // Package private constructor which shares value array for speed. 644 String(int offset, int...

Strange error while adding a feature to my little game (0xC0000005)

c,memory-management,memory-leaks,heap-memory
Hello everyone, I decided some time ago to write my own version of Minesweepers as some practice and I did it. The game ran perfectly, but after deciding to add a "Choose difficulty" option the window freezes and I get an error message, saying that the program does not respond....

Java Card memory leak in for loop?

for-loop,memory-leaks,javacard
I know that Java Card VM's doesn't have have a garbage collector, but what happens with a for loop: for(short x=0;x<10;x++) {} Does the x variable get utilized after the for loop, or it turns into garbage? Just in case I have a transient byte array called index from size...

Itemrender of DataGroup won't release memory - flex(Adobe air)

actionscript-3,flex,memory-leaks,air,desktop-application
i have a datagroup compoenent in Adobe Air application and i have used custom itemrenderer in it, i attached source code of itemRenderer as well as i attached profiling of it, Question: When i come back from other module to the module which have this datagroup at that time it...

Recommended way of returning a reference from a function in C++

c++,memory-management,memory-leaks
I have been using this approach for returning references from functions in C++. However, I suspect that there is better patterns to perform operations like this. Also, I guess that this approach implies in memory leak. class A {}; A& return_instance_of_A(){ A* result = new A(); return *result; } Using...

Memory leak using opencv : VideoCapture

c++,qt,opencv,memory-leaks
I have developed an application with Qt Creator 2.4.1 (Qt 4.8.4) and OpenCV 2.4.2 that reads images from a folder and displays them. It uses cv::VideoCapture and QGraphicsScene/QGraphicsView. It runs well, however I encounter a memory leak : if I look at the consumed memory in task manager, memory goes...

OnDetaching function of behavior is not called

wpf,events,mvvm,memory-leaks,behavior
I have WPF behavior on specific control. When I close the window that hold the control the OnDetaching function is not called. The behavior continues to exist (because of the events to which it's registered), although the window does not exist anymore (memory leak). Why the OnDetaching function does not...

Why if I call pictureBoxPreview1.Image.Dispose() for only one camera, memory usage spikes?

c#,memory-leaks,picturebox
I am showing the images that I capture from two cameras in a picturebox (the same for both). Each camera image is shown in a different ROI of the picturebox. My problem is that the memory used by the application is increasing continuously, most probably I am missing freeing some...

C# OpenXML memory leak

c#,memory-leaks,openxml-sdk
I had noticed memory leak in my application and tried to find it out. I don't know good and free memory leaking discovering techniques (any suggestions?) so I made it simple - inserted memory usage prints (with and without GC) and then dig deeper where biggest leak was. Fixable I...

C# calling IDisposable.Dispose() vs making object null

c#,memory-leaks,garbage-collection,idisposable
Consider the following code: A. Toy Class class Toy { private string name; public string Name { get { return name; } set { name = value; } } private ToyAddon addOn; public ToyAddon AddOn { get { return addOn; } set { addOn = value; } } public void...

How to find if I have a memory leak

c++,memory-leaks
I wrote a number crunching algorithm. The idea is that: A small main programs needs very few memory (starts at 2 MB) Then, in a loop, it calls a function that needs quite some memory (around 100 MB) which should be released when the function end. In order to understand...

Measure memory usage of a certain Linux driver module

memory,memory-leaks,linux-kernel,linux-device-driver
I want to check whether the kernel driver module which I just finished has a memory leak problem. But I don't know how to do it in kernel space. Dynamic memory allocation is very hard to handle I think. Anyone has the experience in debugging such memory problem in kernel...

WPF ViewModel GC

c#,wpf,mvvm,memory-leaks,garbage-collection
I have a ViewModel that on receiving an event from a Model, shows a dialog to the user by newing up the dialog's ViewModel and passing it to the dialog for data binding, i.e., public class MainViewModel { ... private void OnModelRaisedEvent(object sender, EventArgs e) { DialogViewModel dialogViewModel = new...

How to prevent memory leak in JTextPane.setCaretPosition(int)?

java,swing,memory-leaks,jtextpane,caret
I'm working on a Java application with Swing-based GUI. The application uses JTextPane to output log messages as follows: 1) truncate existing text to keep total text size under the limit; 2) append new text; 3) scroll to the end (actual logic is slightly different, but it's irrelevant here). I...

Realloc doesn't work in a while loop

c,memory-leaks,realloc
I need help with my C assignment. The task is to write a program, which takes string input of unknown length. Also I need to separate words, that's why I use char**. Program stops taking input, when a special word appears. You can see my code bellow: char **words=NULL; maxWords=1;...

Can't convert hprof dump

android,memory-leaks,memory-dump,eclipse-memory-analyzer
I try convert dump from Anroid Device Monitor to Eclipse Memory Analyzer format. I use next command hprof-conv dump.hprof converted-dump.hprof and i get error hprof-conv: command not found I do this in a /platform-tools folder. When I run the same command on another computer everything works fine.What is problem?...

iOS Haneke - memory warning then crash

ios,uitableview,swift,memory-leaks,haneke
I am developing an app that fetches images from Twitter using the Haneke library. Once I get the images, I display them using a UITableView. I fetch 10 pictures at a time. My app loads but quickly crashes due to a memory leak. The code I am using to...

Managing memory of Vector3's created to move gameObject

c#,memory-management,memory-leaks,unity3d
I'm coming from a C++ background and am new to both C# as well as Unity5 Game Engine. I'm currently working through some of the tutorial projects (Space Shooter) and have a doubt about memory management. Consider this code to apply user input to move the player gameObject: void FixedUpdate...

Are memory leaks possible with decltype(new any_type())?

c++,c++11,memory-leaks,g++
I am checking for any memory leaks possibility with class pointers using valgrind and found out that following program has no memory leaks : #include <iostream> #include <utility> #include <memory> using namespace std; class base{}; int main() { unique_ptr<base> b1 = make_unique<base>(); base *b2 = new base(); cout << is_same<decltype(new...

Android memory leak on textview - LeakCanary (Leak can be ignored)

android,memory-leaks,ddms,android-memory,leakcanary
I keep having the following memory leak as displayed by LeakCanary, when I go from my splash screen to the mainactivity. I understand that this is an expected leak due to fault in the Android OS itself, but is there a way I can avoid this (by setting specifics of...

Possible to free Context from Singleton in Android to prevent memory leak

android,performance,memory-leaks
I'm maintaining a legacy project where I can't do much refactoring due to limitations. But I just found a possible memory leak in below scenario. Pass a Fragment to a singleton class Foo.getInstance().setBar(fragment); Assuming the static instance lives longer then we need it, Is it a good approach to null...

Weird memory leak in Visual Studio C++ project

c++,c++11,visual-studio-2013,memory-leaks
I use unique_ptr. For creating this poiters, I use this code snippet: template<typename T, typename ...Args> std::unique_ptr<T> make_unique(Args&& ...args) { return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); //line 44 } I test my project for memory leaks with help built-in memory leak checker. I get the following result: Detected memory leaks! Dumping objects ->...

Huge memory leak during Hibernate entity persisting, why?

java,hibernate,jpa,memory-leaks,persistence
I am using Hibernate with JPA EntityManager, not Hibernate sessions. Most people seem to recommend using a new EntityManager for every transaction, so that is what I'm doing. So, I create 10000 new entities in a row. The heap usage is about 90 MB on the first iteration and 5...

How to avoid the memory issue while scrolling an UICollectionView which loads lot of images from Remote server?

ios,multithreading,memory-leaks,uiimageview,uicollectionview
I'm displaying lot of images (5k images) in UICollectionView. These images has been download from remote server. When I scroll from top to bottom and vice versa of the UICollectionView for 5 to 6 times, my app get crashes and I received error "Terminating app due to memory pressure". Please...

How to safely fill Boosts's pointer containers?

c++,boost,memory-leaks,smart-pointers,boost-ptr-container
The first example for Boost Pointer Container adds a raw pointer to the structure: class zoo { boost::ptr_vector<animal> the_animals; public: void add_animal( animal* a ) { the_animals.push_back( a ); } }; But what if push_back, or any other member function that might trigger reallocation, throws an exception during the process?...

I'm getting a memory leak for fopen_s but nothing is 'new'ed or 'malloc'ed

c++,memory,memory-leaks
I'm using MS VS2010 with a plugin called Deleaker to spot any memory leaks I might miss. It's telling me that there is 2 memory leaks on the fopen_s line but I'm not using new or malloc on anything on that line. Every other time it has found a leak,...

C# code calling C++/CLI class method - new instance still has old instance values

c#,memory-leaks,c++-cli,marshalling,destructor
I am a newbie in terms of working with both C# and C++/CLI code together. In my C# code, I am creating a new instance of a class FooClass and running a method FooClass:ParseCmdArgs, which takes in a System::String, converts to a std::string, and then pushes to a vector "bars"...

How to fix D “memory leaks”

memory-leaks,d
So I've been searching for a solution to this problem for some time. I've written a program to take data from two separate text files, parse it, and output to another text file and an ARFF file for analysis by Weka. The problem I'm running into is that the function...

Retain cycle in Swift when Object A has Object B as a property and Object B has an array property that contains Object A?

ios,swift,memory-management,memory-leaks,retain-cycle
Confused about a situation that might be a retain cycle? I understand that if class Object-A { var b: Object-B } and class Object-B { var a: Object-A ] then above is horrible design because if you do var a = Object-A() var b = Object-B() a.b = b b.a...

FirebaseAuth Memory Leak in Activity

android,memory-leaks,firebase,firebase-android,leakcanary
I added the awesome LeakCanary library in my app and pretty soon I started to receive various reports for a leak generated by the FirebaseAuth Object that I use in the various activities. Now my question is: is it a leak generated by the Firebase library itself or I should...

cuda-memcheck fails to detect memory leak in an R package

r,memory-leaks,cuda,valgrind
I'm building CUDA-accelerated R packages, and I want to debug with cuda-memcheck. So in this minimal example (in the deliberate_memory_leak GitHub branch), I create a memory leak in someCUDAcode.c by commenting out a necessary call to cudaFree. Then, I see if cuda-memcheck can find the leak. $ cuda-memcheck --leak-check full...

Memory leak with web audio api oscillator

javascript,memory-leaks,web-audio
http://codepen.io/superuntitled/pen/EjZOjw/?editors=001 I have a little web instrument (see link above) that has a memory leak, and I am unsure how to plug it. The following function is called when an element is hovered over (there are a couple hundred of these). function tone(id, freq, tonelength) { gainNodes.id = audioCtx.createGain(); osc.id...

Is an event bus unregister necessary

android,memory-leaks,event-bus
I'm implementing MVP pattern in Android and I'm using EventBus to let know the Presenter from activity "A" that something happen at activity "B" to update views from "A". I registered the presenter to EventBus inside in constructor but I don't see any place where I could unregister it. public...

How to free memory allocated by native method on Java side?

java,c++,memory-leaks,jni,native
I am trying to pass a byte array (with random data) from native to Java and I am not sure if this causes any memory leak or not. Here's the C++ code. JNIEXPORT jbyteArray JNICALL Java_com_sample_test_jni_TestJNI_return_1byte_1array (JNIEnv *env, jobject obj) { unsigned char *byteArray = new unsigned char[LENGTH]; srand(12345); for(int...

Declaration of FigureCanvasTkAgg causes memory leak

python,python-2.7,matplotlib,memory-leaks,tkinter
I'm having difficulty figuring out just why the declaration of FigureCanvasTkAgg causes a memory leak, I have the following lines in my class __init__ method: # pndwinBottom is a paned window of the main screen self.__drawplotFrame = Frame(pndwinBottom, width=WIDTH, height=HEIGHT) # the frame on which we will add our canvas...

memory leak in node regex parser?

javascript,regex,node.js,memory-leaks
The following code causes node to consume a lot of ram and crash when it runs out of memory. However if I change the length of the found string from 13 to 12 everything is fine. It looks as if strings returned by a regex search contain a hidden reference...

Char* Array Memory Leak

c++,arrays,memory-leaks,valgrind,dynamic-memory-allocation
I am having issues de-allocating memory that I used in my char* array. In my code snippet below, I am creating a char* array named input that holds pointers to single words at a time followed by a pointerNULL at the end of the array. This is the only time...

Memory leak with CIColor spritekit

memory-leaks,sprite-kit,instruments
I created a class that would generate a hud item, this hud item can animate the resulting texture which is a gradient created using cicolor that is then saved into a uiimage which is in turn used for an sktexture. I've noticed now that i am getting a lot of...

What is the cause of this strange Scala memory leak? [duplicate]

scala,memory-leaks
This question already has an answer here: is memory leak? why java.lang.ref.Finalizer eat so much memory 2 answers Even with 7G of heap space, this will run out of memory. import scala.collection.mutable.Set class Foo() { val anEmptySet: Set[Int] = Set() def bar(ints: Traversable[Int]): Unit = {} override def finalize()...

Corrupted data returned by dynamic memory in C++

c++,memory-leaks
I have problem that when i return the data allocated dynamically in C++, some data becomes corrupt. Can someone please tell, what is the reason? I think in class B, data is overwritten //Class A , which contains the original data class A{ char buffer*; public char* fillData(int size) {...

Where is memory leak in this code?

c,memory-leaks
I am not able to figure out memory leak in my code My Valgrind is giving ==26373== HEAP SUMMARY: ==26373== in use at exit: 24 bytes in 1 blocks ==26373== total heap usage: 7 allocs, 6 frees, 136 bytes allocated ==26373== ==26373== 24 bytes in 1 blocks are definitely lost...

How to fix/correctly initialise/clean up matrix class leaking memory

c++,memory-leaks
The following example code using the SmallMatrix-class from SG2 package seems to cause a memory leak. In this simplified example only little memory is leaked. But my more involved algorithm tends to run out of memory. #include "small_matrix.hpp" int main() { SmallMatrix<double> S(1); } See the Valgrind output below. 8...

w3wp.exe Garbage Heap is FULL of Free object space and keeps on growing

memory-leaks,garbage-collection,heap,w3wp.exe
My IIS app (.NET 4.0, IIS7) is continually growing in memory, and eventually falls over, as if I have a memory leak. So I took a DMP while it was up around 1.7GB and cracked it open in WinDbg. The dumpheap -stat command showed that while I had a fair...

C - memory leak in case of big input [closed]

c,memory-leaks,valgrind
For an assignment, I have to order a list of students. Each one is represented by a number (string of size 15), his father's lastname (string 20), his mother's lastname (string 20) and his firstname (string 20 also). I did a program that build from a file the list of...

Simple node.js app deployed to Bluemix seems to be leaking memory

node.js,memory-leaks,bluemix
I am learning node.js, and have a fairly simple application which seems to be leaking memory when deployed to Bluemix. I need assistance in determining if this is caused by my code, or a module I am using. When deployed with the Monitoring and Cloudant services it would crash with...

C# Memory Leak on on different machines

c#,memory-leaks,bitmap,garbage-collection
Background info I've developed a desktop application with Windows Form (C#) for scanning, previewing and saving images. The app behaviour while scanning is the following: Scan n images Get a Bitmap for each image and store it in a temporary file Show resized thumbnails as a preview Image memory management:...

Sandbox for memory

java,memory,memory-leaks
Java supposed not to have memory leaks but it's still possible. When my program has memory leak I can fix it (I hope). But when some third party packages have it what can I do? Practically nothing except don't using this package. Is there another solution? I like idea of...

Why is there a memory leak on SHGetFolderPath()? (C++)

c++,memory-leaks,mfc,intel-inspector
I am runing Intel Inspector for finding memory leaks in an application. Now, the case is this: assume there is a function called MyGetPath() which does the following: _TCHAR szFolderPath[520] =_T(""); SHGetFolderPath(NULL,CSIDL_PROGRAM_FILES,NULL,NULL,szFolderPath); return _T("MemLeak"); When I run the Intel Inspector it reports a leak by 40 bytes, and the allocation...

What diagnostic tools are available for Node.js applications?

node.js,memory-leaks,diagnostics
There are many tools out there, which diagnostics tools are good for diagnostic memory leak issues for node.js applications?

How to fix this memory leak in C++ project?

c++,memory-leaks
I have very simple code snippet: struct simple_string { simple_string(size_t size, char ch) : buffer_(new Buffer(std::basic_string<char, std::char_traits<char>>(size, ch).c_str(), size)) //first memory leak { } ~simple_string() { buffer_->release(); delete buffer_; } struct Buffer { explicit Buffer(const char* str, size_t size) : str_(new char[size + 1]), //second memory leak count_(1) { std::char_traits<char>::copy(str_,...

Wpf RadDocking memory leak

c#,wpf,memory-leaks,telerik
I was tracking a problem of memory leak related to an event handler,while I've discovered that each time I open a raddoCking then I close it I got around 500kb of memory used and not released. I'm using MVVM pattern and as far I've seen its not related to the...

Android - effective performance and memory management

java,android,memory-management,memory-leaks
I have a class MyClass which contains a large buffer, about 12Mb. While my application is working, the instance of this class is constantly (50 times per second) updated. What would be the most memory and performance wise way : to create a new object for each update and let...

Does asynchronous code cause memory leaks?

javascript,node.js,memory-leaks
I'm concerned if asynchronous operations are prone to memory leaks. My context is Javascript used both on the frontend as well as backend (node.js) On the execute operation, a delegate IResponder is created. It has the reference to the main module, as well as success and fault methods. The exampleModule...

Will this particular use of an anonymous Runnable cause a memory leak?

java,android,multithreading,memory-leaks
private class ProductFragment extends Fragment implements OnGetProductFromDBListener { Activity a; void onCreate { a = getActivity(); new GetProductFromDB(); } void onGetProductSuccess(Product product) { // This is not called from the main thread because of the implementation of GetProductFromDB a.runOnUiThread(new Runnable() { void run() { // do some UI and Views...

EditText addTextChangedListener cause memory leak

android,memory-leaks,leakcanary
I use LeakCanary to check my app for memory leak, and it reports a leak as follow public AutofitHelper setEnabled(boolean enabled) { if (mEnabled != enabled) { mEnabled = enabled; if (enabled) { mTextView.addTextChangedListener(mTextWatcher); mTextView.addOnLayoutChangeListener(mOnLayoutChangeListener); autofit(); } else { android.util.Log.i("linlian","AutofitHelper.setEnabled()remove="+mTextView); mTextView.removeTextChangedListener(mTextWatcher); mTextView.removeOnLayoutChangeListener(mOnLayoutChangeListener);...

C++ Pointer being freed was not allocated (possibly, an issue with unique_ptr or boost::ublas)

c++,boost,memory-leaks,unique-ptr,ublas
This is a follow up on one of my previous questions. The issue that I am dealing with is explained in detail in the formulation of this question. Unfortunately, I was not able to provide a minimal example that showcases the problem. In this question, I am making an attempt...

Memory leaks despite destructor call

c++,visual-studio-2012,memory-leaks
I'm working on a class LinkedList which looks like this: private: LL_element* first; LL_element* last; int size; public: //constructor Linkedlist(): first(NULL), last(NULL), size(0) {} //destructor ~Linkedlist(); //adds element at the end of the list. void push_back(int value); //removes an element at the end of the list. bool pop_back(int& value); The...

OracleBulkCopy Memory Leak(OutOfMemory Exception)

c#,oracle,memory-leaks,bulkinsert,sqlbulkcopy
Below is the code I used to bulkcopy data from a temp table dataTable into a destTable in Oracle Database. The dataTable has about 2 million records. using (OracleBulkCopy bulkCopy = new OracleBulkCopy(VMSDATAConnectionString)) { try { foreach (OracleBulkCopyColumnMapping columnMapping in columnMappings) bulkCopy.ColumnMappings.Add(columnMapping); bulkCopy.DestinationTableName = destTableName; //bulkCopy.BatchSize = dataTable.Rows.Count; //bulkCopy.BulkCopyTimeout =...

Should I do obj = null after arraylist.add(obj)

java,arrays,object,memory-leaks,null
I was just wondering if we should do obj = null after adding it into an array. Note that this is about a special case, read below. First, let's consider class A like this: public class A { public void doSomething(B object) { // some code here } } and...

Memory leaks and jQuery plugin

javascript,jquery,memory-leaks
I'm writing a destroy method for a jQuery plugin. I'm concerned about the potential for memory leaks caused by references to DOM objects persisting after the destroy method has been called. Does the code below have potential to cause a memory leak? jQuery.fn.foo = function(){ var $bar = $('.bar'); $bar.on('click.foo',...