Menu
  • HOME
  • TAGS

Unity c# List memory leak

c#,list,memory-leaks,unity3d

Apparently this is a bug with Texture2D.Apply(). It's so deep, Unity's profiler did not show the leak, but external tools did. Unity have acknowledged the problem and are seeking out a solution. No date was given. Thanks for the help :-)

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

java,swing,memory-leaks,jtextpane,caret

The reason for this is that you are running the for loop in the event dispatch thread (see Event Dispatch Thread). This is the thread in which all user interface interactions happens. If you are running a long task, then you should run it in a different thread, so that...

Retain cycle with parent-child construction

ios,objective-c,memory-management,memory-leaks,retaincount

The word you are looking for is "retain cycle". The simplest retain cycle would be an object having a strong reference to itself. Very rare because it is rather pointless. The most common case is A having a strong reference to B and B having a strong reference to A....

How to fix D “memory leaks”

memory-leaks,d

Are the strings in the returned data still pointing inside the original text file? Array slicing operations in D do not make a copy of the data - instead, they just store a pointer and length. This also applies to splitLines, split, and possibly to doSomeOtherCalculation. This means that as...

memory leak in node regex parser?

javascript,regex,node.js,memory-leaks

I observe the same behavior in Chrome. I think the two (node.js and Chrome) behave the same because they are based on the same Javascript engine (V8). There is no memory leak, but there is a problem with the garbage management in Javascript. I deduct this from the observation, that...

Objective-C memory leak when returning NSString

ios,objective-c,iphone,memory-management,memory-leaks

What you posted is OK. The only rule at this point is that methods contain "create" or "alloc" will return an object that needs to be explicitly released. In your case that is the string returned in the readString method. Since the object will be returned you need to retain...

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

java,android,multithreading,memory-leaks

Strictly speaking, it won't necessarily result in a memory leak. BUT - for the duration of the thread's run it will hold a reference to the outer class (ProductFragment in your case). So whether it's a memory leak will depend on how long the thread will run for, and whether...

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

actionscript-3,flex,memory-leaks,air,desktop-application

i have used DataGroup as parent component and i have define above itemRenderer in itemRenderer property of the DataGroup, and in dispose function i have define DataGroup.itemRenderer is null in DataGroup. so it will eligible for GC. and i see that now no instance of itemRenderer is in memory.

how can i find which application is causing memory leaks

java,tomcat,memory-leaks,heap

You may use the combination of jmap/jhat tools (Both these are unsupported as of Java 8) to gather the heap dump (using mmap) and identify the top objects in heap (using jhat). Try to co-relate these objects with the application and identify the rogue one.

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

c++,memory-leaks

Because it is a way memory allocator works. free'ing or delete'ing memory from code doesn't definitely means that your user space memory allocator will be eligible to return allocated memory to the OS. The reason is that it can have some optimization policies. Imagine that you continuously malloc(3) 100 MB...

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

c#,c++,memory-management,dll,memory-leaks

You need to call the corresponding "free" method in the library you're using. Memory allocated via new is part of the C++ runtime, and calling FreeHGlobal won't work. You need to call (one way or the other) delete[] against the memory. If this is your own library then create a...

Does under-utilized memory cause memory leak?

c,memory-leaks,strncpy

In fact these two statements char buffer[32]; strncpy(buffer,uk,sizeof(buffer)); are fully equivalent to the following declaration char buffer[32] = "ln"; It is a valid declaration and there is no bug or memory leak.:) In the both cases all elements of buffer that were not initialized by the string literal's characters (or...

Managing memory of Vector3's created to move gameObject

c#,memory-management,memory-leaks,unity3d

It creates a new Vector3 every FixedUpdate() (60 times per second, by default), even if user is not providing input. Vector3 created on a stack. And releasing once you left function. (No garbage collection) When you assign a variable movement to rigidbody.velocity, you are simply copying struct. (No garbage...

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

android,performance,memory-leaks

Use WeakReference in the singleton

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

c,memory-leaks,valgrind

You aren't even mentioning which system this is for. Because of Valgrind I assume Linux. You don't mention where you allocate the variables. Apparently not on the heap since Valgrid only reports 12.8kb there. If I remember correctly (and I know very little of Linux) processes have a stack size...

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

Generally speaking, with manual reference counting and automatic reference counting, reference ilands will leak. Reference cycle can be composed by more than just 2 objects. That said I encourage you to test some code in a playground since the example in your question has some syntax and language errors. The...

What are memory leaks in C?

c,memory-leaks

This program demonstrates a significant memory leak. On many systems, it won't run very far. #include <memory.h> int add (int a, int b) { char *hog = malloc (1024 * 1024 * 1024 * 50); return a + b; } int main (void) { int sum = add (add (6,...

Memory Leak on AppCompatActivity using LeakCanary

android,memory-leaks,leakcanary

You need to call LocalBroadcastManager.unregisterReceiver method. LocalBroadcastManager.getInstance(getApplicationContext()).unregisterReceiver(screenReceiver) http://developer.android.com/reference/android/support/v4/content/LocalBroadcastManager.html...

iOS Memory Leak after advanceToNextInputMode in Keyboard Extension

ios,memory,memory-leaks,ios-keyboard-extension

I have this exact problem. It is Apple's fault. The total amount of memory leaked is pretty tiny though. File a bug report so they'll take it more seriously (I've already filed, but more always help).

How to read the memory snapshot in Visual Studio

c#,visual-studio,memory-leaks

The Paths to Root view shows the references to this type keeping it from being garbage collected. Since your class is a Xaml page, the reference which keeps the class alive is a CLR handler for the Xaml page. These show up as RefCount Handle. Count and reference count...

Corrupted data returned by dynamic memory in C++

c++,memory-leaks

Here is your error: char buffer*; it should be char *buffer; And the prototype of the method A::fillData is char *fillData ( int ), so you need to call it with a int parameter. Like this: data=obj.fillData( 32 ); EDIT: I didn't see it, but this i not C++ at...

Measure memory usage of a certain Linux driver module

memory,memory-leaks,linux-kernel,linux-device-driver

It's really hard to track allocation and freeing memory in a kernel module, but you have some facilities still. Here are a couple tools and approaches to investigate memory leakage in kernel space. /proc/slabinfo (slabtop). It collects information about kernel structures. Not really about a module one. But it still...

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

c#,wpf,dll,memory-leaks,msvcrt

The answer was not easy to find. I had tried each DLL that I suspected one by one. The leak was an undeleted array in a C++/CLI wrapper class. Since it is a managed dll, I think, the native "new" calls are traced through msvcr110.dll, and ANTS shows leak in...

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

c++,memory-leaks

I don't get memory leak using g++ 4.8.2 + valgrind 3.10. I get it however in VS 2015 EE detecting with CRTDBG_MAP_ALLOC but that is a false positive. Set str_ and buffer_ to nullptr after deleting pointers and then call destructor explicitly: a.~simple_string();, it will call destructor twice nothing really...

Huge memory leak during Hibernate entity persisting, why?

java,hibernate,jpa,memory-leaks,persistence

The problem is you hold the first EntityManager opened the whole time, while only clearing and closing another EntityManager that's only used for persisting one item. At the end, you have all the Account entities loaded in the first EntityManager....

What is “allocation context”?

c++,c,memory-leaks,allocation

I got a response from one of the authors. The definition is as follows: allocation context It refers to the call stack contents at the time of an allocation. For example, if an allocation site is contained in function foo and the function is called from main (during the execution),...

Memory leak with web audio api oscillator

javascript,memory-leaks,web-audio

The thing with osc.id is a little weird, since you're setting id as a property name instead of osc[ id ] – but leaving that part aside, you'd want to add this to the bottom of your tone() function: var current = osc.id; current.stop( audioCtx.currentTime + 2 ); current.onended =...

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

java,string,memory-leaks

Yes, String was changed significantly in Java 7 update 6 - now separate String objects never share an underlying char[]. This was definitely a trade-off: Strings no longer need to maintain an offset and length (saving two fields per instance; not a lot, but it is for every string...) One...

How to measure memory consumption of DXL script?

memory-leaks,dxl

The biggest memory "leak" would be open modules that are no longer being used. So of course you should be closing those. Next you want to keep the production of new strings to a minimum since each new one creates an entry in a string table. You can find an...

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

c++,boost,memory-leaks,unique-ptr,ublas

Well. I'm thinking you're really pushing the type system. I cannot begin to fathom why you would want this egregious type hierarchy: That's a lot of damage done in ~60 lines of code. I cannot think of a reasonable situation where Liskov Substitution Principle holds for this hierarchy. I also...

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

c++,visual-studio-2012,memory-leaks,forward-declaration

The respective warning is C4150. It should be active by default and it is categorized in warning level 2 (which should be active too, since default warning level is W3 afaik). Note: Instead of lowering the warning level, try to pragma warnings in specific cases....

Possible Memory Leak with prepared statements?

php,sql,memory-management,memory-leaks,prepared-statement

Do you have blob column? The number 4294967296 indicates you are trying allocate memory for max length of blob column. It can be a bug but not a leak, and the culprit could be the bind statement. If you have a blob column and it keep giving error, try cast...

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

java,memory-leaks,garbage-collection,websphere

The error message you get indicate a problem with native memory, that is, memory outside the heap. The garbage collector is not responsible for off-the-heap memory, why you can not affect this error with garbage collector settings. Excessive garbage collecting should not lead to native memory issues (unless there is...

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

c++,c++11,memory-leaks,g++

The operand of decltype (and also sizeof) is not evaluated, so any side-effects, including memory allocation, won't happen. Only the type is determined, at compile-time. So the only memory allocations here are in make_unique and the first new base(). The former is deallocated by the unique_ptr destructor, the latter by...

Realloc doesn't work in a while loop

c,memory-leaks,realloc

The second argument to calloc() should be the size of what the pointer points to, i.e. the pointed-to-type, not the size of the pointer-type itself. For example, suppose you want to allocate space for 10 int, assigning the result to an int *p, any of the following would be proper...

memory leak vs. access violation, class design issue

delphi,memory-leaks

Bonus answer: atestClass will still be pointing to a memory address even though you called free. if you tried to access the memory after calling free you could be accessing the wrong data if something else is now using that memory location, or get an access violation if the memory...

Does asynchronous code cause memory leaks?

javascript,node.js,memory-leaks

Circular references do not cause problems for good JavaScript garbage collectors. When your objects become eligible deallocation in this case depends on when ExampleModule lets go of its reference to your IResponder....

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

ios,multithreading,memory-leaks,uiimageview,uicollectionview

There are three levels of problem here: The most egregious problem is that you're adding a new UIImageView to the cell every time the cell is used. But cells can be reused many times, so you're adding many image views to the cell. The images associated with all of those...

FirebaseAuth Memory Leak in Activity

android,memory-leaks,firebase,firebase-android,leakcanary

The answer is hidden in this line of the leak report: * references com.ispimi.ispimi.DetailsFragment$4.this$0 (anonymous class implements com.firebase.client.ValueEventListener) You need to make sure to remove any listener you added before your Activity is destroyed. Balance adding a listener with removing it. For example, if you added it in onCreate remove...

PHP 5.5.6 Random memory leak

php,apache,pdo,memory-leaks,freetds

I am going to answer this one for myself and for future reference. The actual bug was in pdo_dblib after all. According to this bug - https://bugs.php.net/bug.php?id=67130 which I found yesterday PDOStatement::nextRowset() caused memory corruption and thus all our problems. I verified it by removing this portion of our code...

Wpf RadDocking memory leak

c#,wpf,memory-leaks,telerik

You need to call RadPane's RemoveFromParent() method for it to be garbage collected. Please check out these links: http://www.telerik.com/forums/radpanegroup-memory-leak http://www.telerik.com/forums/radpane-not-garbage-collected-when-closed...

Memory leaks and jQuery plugin

javascript,jquery,memory-leaks

Looks fine to me. Your variable $bar is declared within the function scope so it won't be accessible outside of it. $bar = null; - is enough to clear the reference to your element. ...

Where is memory leak in this code?

c,memory-leaks

You haven't freed graph. At least not in the code you have shown.

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

node.js,memory-leaks,bluemix

I have confirmed that the specified sample app does perform garbage collection in Bluemix with the memory set to 1gb. I tested using apache bench with 1000 requests to '/' with 10 concurrent transactions. I suspect the earlier volume tests were too low to trigger a gc....

Memory leak using opencv : VideoCapture

c++,qt,opencv,memory-leaks

I found what causes the problem and how to fix it, reading this thread. From the Qt documentation: void QGraphicsScene::removeItem ( QGraphicsItem * item ) Removes the item item and all its children from the scene. The ownership of item is passed on to the caller (i.e., QGraphicsScene will no...

EditText addTextChangedListener cause memory leak

android,memory-leaks,leakcanary

I found a related topic Android memory leak on textview the Utils.clearTextLineCache() maybe a good workarounds....

Sandbox for memory

java,memory,memory-leaks

The best way is to launch another JVM, communicate with it with socket(for example), and kill the JVM after it's done. It'll be interesting to discuss whether we can sandbox it within the same JVM. After you are done with using the 3rd party library, and you are no longer...

Android - effective performance and memory management

java,android,memory-management,memory-leaks

Some java virtual machines, when creating small objects of known size, which is not viewed outside of it scope, creates object in stack, rather than in heap. For example oracle JVM after 7th version doing so. So it is may be more efficient to create small constant size temporary arrays...

How to find if I have a memory leak

c++,memory-leaks

First, make sure that over a long period of time (for example if one iteration takes a minute, run a couple hours) the growth continues. If the growths asyptotes then there's no problem. Next I would try valgrind. Then if that doesn't help, you'll have to binary search your code:...

OnDetaching function of behavior is not called

wpf,events,mvvm,memory-leaks,behavior

The OnAttached is called when XAML parser parses XAML and creates instance of behaviour and adds this to BehaviorCollection of target control which is exposed as DependencyAttached property. However when if the view is disposed, the collection (Behavior collection) was disposed of, it will never trigger OnDetaching method. If the...

How to safely fill Boosts's pointer containers?

c++,boost,memory-leaks,smart-pointers,boost-ptr-container

The concerns you have are very valid if you were using std::vector<animal*> instead of boost::ptr_vector<animal>. Boost.PointerContainer is designed to handle pointers to resources that need to be freed, so it absolves you from having to worry about such things. The Boost documentation provides exception safety guarantees for the various member...

OmniFaces UnmappedResourceHandler seems to leak resources when composite components are used

jsf-2,memory-leaks,composite-component,omnifaces,unmappedresourcehandler

UnmappedResourceHandler memory leak on composite components is confirmed and has been solved by this commit for 2.1, this commit for 1.11 and this commit for 1.8.3. All versions are as of today available in Maven....

Valgrind and misuse of new[]?

c++,memory-leaks,valgrind

You need to delete[] your arrays when you finished with them. For example: double *initialize_TriSol_b(){ double *a = new double[num_spline_pts]; //Valgrind does not like double *b = new double[num_spline_pts]; //Valgrind does not like for (int i = 0; i < num_spline_pts; i++){ a[i] = 1; b[i] = 4; } *a...

WPF ViewModel GC

c#,wpf,mvvm,memory-leaks,garbage-collection

Actually you do have dependency injection right now, since you are injecting the viewmodel into the dialog via constructor. While the dialog view is running, it contains a reference to dialogViewModel in MainViewModel. When you close the dialog, the control is given back to the OnModelRaisedEvent method, and immediately after...

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

c#,memory-leaks,picturebox

You can follow the answer from the following link WPF CreateBitmapSourceFromHBitmap() memory leak In brief bitmap.GetHbitmap() is leaking and must be disposed BTW in case of your bitmap being System.Drawing.Bitmap you can just write g.DrawImage(bitmap, dstRoi, srcRoi, GraphicsUnit.Pixel); since Bitmap is Image BTW you can cache your image by picture...

C++ Templates specialisation char* and Valgrind

c++,templates,memory-leaks,char,valgrind

You should replace new char(strlen (element) + 1); // this allocate one char with given initial value by new char[strlen (element) + 1]; // array of (uninitialized) char to allocate array of char. then you have to call delete []....

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

c#,memory-leaks,garbage-collection,idisposable

Now it was suggested to me that check if a "having-a" object is implementing IDisposable then call the dispose method of it. IDisposable is a pattern that is used to free unmanaged resources that need to be explicitly released, as the GC isn't aware of them. Usually, a class...

Declaration of FigureCanvasTkAgg causes memory leak

python,python-2.7,matplotlib,memory-leaks,tkinter

I'm gonna guess this is caused by the pyplot figure not being destroyed when the Tkinter window is closed. Like in the embedding in tk example try using Figure: from matplotlib.figure import Figure self.__fig = Figure(figsize=(16,11)) example use: import Tkinter as tk import matplotlib matplotlib.use('TkAgg') from matplotlib.figure import Figure from...

Memory leak with CIColor spritekit

memory-leaks,sprite-kit,instruments

This turned out to be an issue with the AGSpriteButton class which was hogging memory and therefore eventually causing a crash when an advert loaded, you can find a fix here: SKScene Fails to deallocate memory resulting in bounded memory growth...

iOS Haneke - memory warning then crash

ios,uitableview,swift,memory-leaks,haneke

I removed cell.tweetImage?.sizeToFit() from the original code and now it works. Not sure why I had that code in there in the first place but removing it resolved the memory leak issue. If anyone knows why the misuse of cell.tweetImage?.sizeToFit() in this context would cause a memory leak I would...

C# OpenXML memory leak

c#,memory-leaks,openxml-sdk

Well, if we're sticking with free or we're in a production environment, I would use ADPlus to create a memory dump and WinDbg to analyze it. You could Google around there's plenty of knowledge out there on the subject. But the easier way would be to attach a memory profiler...

Single Page App - memory leak explanation

javascript,jquery,memory-leaks

In this specific case, iCheck has a 'destroy' method which 'removes all traces of iCheck' (see the iCheck docs). If you call this when this user navigates away from the relevant view (before the DOM has been modified), there should be no memory leak. Otherwise there would almost certainly be...

Singleton: is there a memory leak?

c++,memory-leaks,singleton

When main code calls Singleton::getInstance()->someMethod() for the first time, isn't the class instantiated twice? No. Calling a static member of Singleton does not instantiate Singleton, so the only instance of Singleton to exist here is the one you create with new. And you only create it once, because once...

JSF mysql tomcat memory leak

java,mysql,tomcat,memory-leaks

You're not closing the Connections thus generating a memory leak. This can be noted here in the stacktrace (emphasys mine): sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.park(Unknown Source) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(Unknown Source) org.apache.tomcat.dbcp.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:582) org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:439)...

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

c,memory-management,memory-leaks,heap-memory

First, you don't allocate your two-dimensional fields correctly. The "outer" field must hold int *, not just int: mineArray = calloc(10, sizeof(*mineArray)); for (i = 0; i < 10; i++) { mineArray[i] = calloc(10, sizeof(*mineArray[i])); } Another potential source of the segmentation fault is that Y might end up uninitialised...

C# Memory Leak on on different machines

c#,memory-leaks,bitmap,garbage-collection

Not quite sure about you MemoryException, please provide full stacktrace. However, I can see you are doing an obvious mistake in your destructor. You SHOULD NOT refer your managed resources in the Destructor. The reason is being that, GC and Finalizer are using heuristic algorithms to trigger them and you...

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

ios,memory-leaks

It isn't leaking memory as such UIDevice currentDevice returns a singleton - that is, each subsequent call to currentDevice will return a reference to the same object instance. This singleton instance is allocated on the first call to currentDevice and this object will remain allocated until your app exits. This...

What diagnostic tools are available for Node.js applications?

node.js,memory-leaks,diagnostics

Yes, IDDE is a powerful tool not only for memory leak detection, but for a wide variety of problem determination of Node.js misbehaviors, including crashes and hangs. Here is the link for overview, installation, and what is new information: https://www.ibm.com/developerworks/java/jdk/tools/idde I would start with nodeoverview command. Note that every command...

iOS - CGImageRef Potential Leak

ios,memory-leaks,cgimageref

Just add this code CGImageRelease(imageRef); From CGImageCreateWithImageInRect document, The resulting image retains a reference to the original image, which means you may release the original image after calling this function. So,what you need to do is just call CGImageRelease to make it retain count -1...

Java Card memory leak in for loop?

for-loop,memory-leaks,javacard

The x variable does not really exist in byte code. There are operations on a location in the Java stack that represents x (be it Java byte code or the code after conversion by the Java Card converter). Now the Java stack is a virtual stack. This stack is implemented...

Memory leaks despite destructor call

c++,visual-studio-2012,memory-leaks

You are checking for memory leaks before foo goes out of scope, so it doesn't have a chance to call its destructor which in turn probably clears all LL_elements (assumption, since you haven't posted destructor code). Try it like this: int main(int argc, const char * argv[]) { { Linkedlist...

Can't convert hprof dump

android,memory-leaks,memory-dump,eclipse-memory-analyzer

to run a binary from the current directory you need to prepend ./ to the name of the binary or use the full qualified path to the binary. E.g. if you are in platform-tools you can run ./hprof-conv /path/to/dump.hprof /path/to/converted-dump.hprof if you are in the directory where dump.hprof is stored...

Weird memory leak in Visual Studio C++ project

c++,c++11,visual-studio-2013,memory-leaks

You shouldn't be using release() unless you're handing off the pointer-raw to someone else (hopefully another std::unique_ptr or a std::shared_ptr, etc). Instead you should be using reset(), or just letting scope-exit destroy the managed object for you. The simplest example using your code that demonstrates bad and good: Bad :...

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

c++,memory-leaks,mfc,intel-inspector

I wrote a very simple program to experiment with it and with Deleaker to find what leaks could happen here: #include <tchar.h> #include <windows.h> #include <Shlobj.h> int _tmain(int argc, _TCHAR* argv[]) { DebugBreak(); // I take snapshot here _TCHAR szFolderPath[520] = _T(""); SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, NULL, szFolderPath); // Then I...

Is following scenario a memory-leak in java?

java,android,memory-leaks

The variable itself will go out of scope and be deallocated (as the call stack shrinks). The object that the variable points to (the ArrayList) still has another reference pointing to it, so it will not be collected. It will go away when no more references (such as your messages...

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

c++,memory,memory-leaks

This happens when functions like fopen make a one time allocation. If you then call fopen again you will not get more leaks. Deleaker tries to hide such "known leaks" but sometimes they are still shown. Debugging this case I see that "leak" comes from this code inside CRT: int...

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

java,c++,memory-leaks,jni,native

The Java GC should clean up any objects you allocate. See this answer for more details....

Potential causes of memory leaks in Android

java,android,memory-leaks,garbage-collection

Is there anything else that I should watch that may cause a noticeable memory leak? Declaring a member field static almost guarantees a memory leak. Anonymous classes that last beyond the lifetime of the parent class, such as Volley Requests, also produce memory leaks, because they hold an implicit...

Getting Memory leak on android fragment

android,gridview,android-fragments,memory-leaks,android-arrayadapter

Without much information to go on, I think you are holding on to your fragment references. Test this by using the adb shell command dumpsys adb shell dumpsys activity <package_name> adb shell dumpsys meminfo <package_name> Navigate various fragments and run this after each time you navigate one of them. Meminfo...

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

r,memory-leaks,cuda,valgrind

This is not valid CUDA code: extern "C" void someCUDAcode() { int a; CUDA_CALL(cudaMalloc((void**) &a, sizeof(int))); mykernel<<<1, 1>>>(1); // CUDA_CALL(cudaFree(&a)); } When we want to do a cudaMalloc operation, we use pointers in C, not ordinary variables, like this: int *a; CUDA_CALL(cudaMalloc((void**) &a, sizeof(int))); When we want to free a...

Creating an instance from assembly throws a memory leak

.net,reflection,memory-leaks

After 2 days searching on the net i have been able to resolve the error. This is the solution for anyone on my situation. The classes you want to load by reflection have to implement the IDisposable interface. These classes have to override the Dispose method. In this method, simply...

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

c#,memory-leaks,c++-cli,marshalling,destructor

You need to make vector<string> bars; a local variable of your function. Or at least an instance field of your class. Right now it's a global variable that will keep it's value as long as you have the DLL loaded into your AppDomain (simply put, for the whole duration of...

URLClassLoader Memory Leak Java

java,memory-management,memory-leaks,urlclassloader

just add the dependency of class loader leak preventer in your build path. maven dependency for this is : <!-- For Classloader leak protection --> <dependency> <groupId>se.jiderhamn</groupId> <artifactId>classloader-leak-prevention</artifactId> <version>1.8.0</version> </dependency> ...

Android bitmap processing - no leak but still OOM?

android,memory-leaks,bitmap

Any suggestions how to fix this without on loosing image quality? Use android:largeHeap="true". Or, use some other native library that allows you to hand over the byte[] and does the rotation and saving to disk for you, to avoid the Bitmap and any Java-level processing of the huge thing....

How to interpret Valgrind output

c++,memory-leaks,valgrind

Is memory leaked exactly at line 374 of main.cpp? No. It just shows the line number in main where the call was made that ultimately leads to the function and line where the memory was allocated. Is it leaked in compute() or maybe at assignment/indexing into results? It says...

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

memory-leaks,garbage-collection,heap,w3wp.exe

Thanks to the suggestion on using PerfView by magicandre1981, and after quite a few very large memory dumps, I've located this issue down to the use of DataRow.DefaultIfEmpty() in a Linq expression. It was part of a support function for carrying out a LeftJoin between two DataTables. With the DefaultIfEmpty()...

Multipart form uploads + memory leaks in golang?

memory-management,memory-leaks,go

If the memory usage stagnates at a "maximum", I wouldn't really call that a memory leak. I would rather say the GC not being eager and being lazy. Or just don't want to physically free memory if it is frequently reallocated / needed. If it would be really a memory...

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

java,arrays,object,memory-leaks,null

Just use: public void doSomething(B b) { arrayList.add(b); } There is absolutely no need to set the parameter to null as it (the parameter, not the object that it refers to) no longer exists when the method exits. Re Note that this is about a special case, read below. I...

OracleBulkCopy Memory Leak(OutOfMemory Exception)

c#,oracle,memory-leaks,bulkinsert,sqlbulkcopy

Found the root cause, the exe is running in 32 bit and it has a 1.5G memory limit. Need to change the target platform and replace Oracle.DataAccess.dll to 64 bit version. Also there is an alternative solution: load data in batch so it will not exceed 1.5 G memory limit....

Square LeakCanary Cannot find symbol

android,memory,memory-leaks,square,leakcanary

Rebuilding the project fixed it for me. There's a deleted answer (I don't know why) by Kaushik Gopal that gives this solution and points to a Github issue...

Char* Array Memory Leak

c++,arrays,memory-leaks,valgrind,dynamic-memory-allocation

I think, your problem is in below case, input[k] = new char[1]; //add the NULL char * input[k] = NULL; here, without free-ing input[k], you're assigning NULL to it. Thus, the previous input[k] is lost. If you really want input[k] to hold NULL, (maybe as a sentinel value), you can...

Is an event bus unregister necessary

android,memory-leaks,event-bus

Unregister is important and when user leaves application that does not mean the resources are cleaned instantly Since the EventBus holds static reference to presenter it is not freed until OS kills the process and so, considered as leak. As for nucleus.presenter.Presenter it will be common to register on...