Questions tagged [memory-leaks]

1

votes
3

answer
87

Views

Is it premature optimization to destruct things as soon as possible?

Let's say that I have a lot of memory that will be allocated at certain points in the program. One of the great debates of memory leaks is that hogging a lot of memory is OK if it's going to be reclaimed by the operating system at the end of the process execution. The problem with this is, it's stil...
user4132815
1

votes
1

answer
179

Views

Is it necessary to clearTimeout inside a recursively invoked timer?

Is it necessary to call clearTimeout() inside a recursively invoked function in Coffeescript? My concern is whether not calling clearTimeout() will possibly cause some sort of memory leak over time if this function is run many many times per second. My thinking is the JS garbage collector handles t...
professormeowingtons
0

votes
1

answer
20

Views

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

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 somethin...
Lucas Zanella
1

votes
0

answer
25

Views

Memory Allocation Issues (possible leak) in WPF application, using Pages and TabContol

Disclaimer: I'm having huge issue with memory managment, within my application. They have poped up first in May, 2018, but thanks to various articles on MSDN and here, SO, I was able to reduce the problem, but not really fix it. After I did some reading, testing and coding, I'm comming here, because...
Vanghern
1

votes
1

answer
561

Views

valgrind shows me a leak when using libxml2

i have a code which i must fix it. It has a leak, I don't know where is the problem, but i think something is bad done. is there anybody who has the same problem and can help me please? ==3923== 32 bytes in 1 blocks are still reachable in loss record 1 of 2 ==3923== at 0x4C2CC70: calloc (in /usr/...
1

votes
2

answer
1.3k

Views

NSJSONSerialization.JSONObjectWithData leaks memory

I have a function which uses NSJSONSerialization.JSONObjectWithData, but some memory was not released. So I tracked down where the leak occurred and tested it with the following function: private func test() { for var i = 0; i < 100000; i++ { let toParse = NSString(string: "{ \"Test\" : [ \"Super me...
K. Biermann
1

votes
3

answer
3.6k

Views

how can release memory from view controller in swift

I need to know how can i (release/free) memory from view controller in tab bar controller project, the deinit method not call for the both view controller. I use the instrument tool it's show me it is in the memory and not free it the following is my code for the both view controllers the first view...
Mustafa
0

votes
1

answer
311

Views

gstreamer rtsp h264 -> udp vp8 memory leak

I am trying to streaming rtsp stream coming from camera(H264 format). I am using following gst command to do streaming: gst-launch-0.10 rtspsrc location=rtsp://login:[email protected] latency=0 buffer-mode=0 udp-buffer-size=0 ! rtph264depay ! ffdec_h264 ! timeoverlay halign=right valign=top ! clocko...
pycott
1

votes
1

answer
495

Views

Apache Ignite Fabric 2.1 crashes on start

I am new to Apache ignite and trying to run it on my local machine.While executing bat file for Ignite,i am getting error related to Out Of Memory.How can i resolve it?.Ignite launches but crashes after works due to Message Queue limit issues.Where would i have to make a change to resolve this issue...
user3148326
1

votes
1

answer
39

Views

Is C++ better at avoiding memory leaks than C? [on hold]

I'm using a C program to control an electrical test system. Our team experienced serious memory leak problem recently and were considering to convert to C++. Could C++ be a solution? Does C++ have any benefits to avoid memory leaks?
J. Shin
2

votes
1

answer
22

Views

Relation between pointers and arrays

I was pretty sure that *(pointer+1) = pointer[1]. My problem is that when i run this code: if (NULL == (*str_array = (char **)malloc(sizeof(char *)*10))) { return ERROR; } splitter = strtok(str, TOKEN); while(splitter != NULL){ if (NULL == ((*str_array )[i] =(char *)malloc(sizeof(char)*strlen(str) +...
Julian Rosenfeld
2

votes
0

answer
23

Views

C, leak on fork without malloc

I'm trying to understand how memory allocation work on fork, even on static or dynamic allocation. I've some trouble to understand some leaks as shown below. With this program : #include #include int main(int argc, char **argv) { pid_t pid; int status; pid = fork(); if (pid == 0) return (...
rSim
0

votes
0

answer
4

Views

JProfiler Heap Walker - select objects that are held by GC Root located in specific Java packages

I have JavaFX application and I have made Heap Snaphot using JProfiler 10.1.5. My current object set (filtered using "use new" selection step) has 46064 objects in 672 classes. I would like to narrow the search range for memory leaks, and filter my current object set to have only objects that are h...
sgnsajgon
3

votes
0

answer
29

Views

Detect when IE11, with its built-in memory leak, runs out of memory (1.5GB recyclable pool)

IE11 has a well-documented iframe memory leak. In a SPA, if you are using iframes the memory will grow to about 1.5GB after which time it will slow down until a crash. My task is to detect when the browser is about to crash and restart the page soon enough. The application is Vue.JS that is embedded...
Edza
0

votes
3

answer
137

Views

How to find possible memory leaks

Does anyone of you know how to find possible memory leaks with re-frame applications. we have app with React and Processing. The problem is that we have a Canvas element with Processing.js, but when we destroy it the Canvas elements are still in the heap. I tried to look into it but always end up at...
wiki one
0

votes
0

answer
6

Views

Memory leak in Bundle.main.loadNibNamed

I have strange memory leak in my class BottomTabView. I have class func for load it class instance from xib by Bundle.main.loadNibNamed @objc class func loadFromNib() -> BottomTabView? { if let topLevelObjects = Bundle.main.loadNibNamed("BottomTabView", owner: nil, options: nil) { //
EvGeniy Ilyin
0

votes
0

answer
6

Views

Pyshark library memory issue

I Would like some help on managing memory consumption of pyshark library. Using it creates an effect of requiring more memory as you process more pcap files. I guess that something is no dereferenced and thus stays in memory forever. For example if you run this script with any pcap file, you will se...
Ciro Alvaro
1

votes
2

answer
382

Views

CDI | Application / Dependent Scope | Memory Leak - javax.enterprise.inject.Instance<T> Not Garbage Collected

I am using Instance as a lazy / dynamic injector in a TomEE Java application, and I have noticed a memory leak in my application. This is a first for me, so it's actually surprising to see a memory leak warning that has been outlined in the Java EE Library : package javax.enterprise.inject; public i...
James
1

votes
1

answer
456

Views

Multiprocessing — Thread Pool Memory Leak?

I am observing memory usage that I cannot explain to myself. Below I provide a stripped down version of my actual code that still exhibits this behavior. The code is intended to accomplish the following: Read a text file in chunks of 1000 lines. Each line is a sentence. Split these 1000 sentences in...
lo tolmencre
1

votes
2

answer
146

Views

Memory Leak, but how can I pass a different context than the one of the activity to solve the Leak?

I have the following leak detected by LeakCanary where it appears that: GC ROOT android.hardware.fingerprint.FingerprintManager$1.this$0 (anonymous subclass of android.hardware.fingerprint.IFingerprintServiceReceiver$Stub) references android.hardware.fingerprint.FingerprintManager.mContext leaks com...
Drocchio
1

votes
2

answer
31

Views

Using Visual Studio Diagnostic Tool to investigate memory consumption/leak

In a WPF application I'm working on, I got the following memory-usage profile from Visual Studio Diagnostic Tools (see image below). So my program keeps allocating more and more memory until I get an OutOfMemoryException. I am new to VS Diagnostic Tools, so the question is: how do I use this window,...
heltonbiker
4

votes
4

answer
109

Views

C++ Dangling Pointers and Memory Leaks

I'm having a hard time understanding how to tell between dangling pointers and memory leaks. I have a few questions on a recent assignment that are puzzling me, and after reading into it, I am still puzzled. I don't want someone to do my homework for me, I want to be able to understand why something...
Vera
2

votes
1

answer
15

Views

pthread_created followed by pthread_join valgrind possible loss c

I've a problem with valgrind errors about loss memory. This is my code: if((err = pthread_create(&handlert, NULL, &handler, NULL)) != 0) perror(..) if((err = pthread_create(&mastert , NULL, &createmaster, NULL)) != 0) perror(..) for(int i = 0; i < THREADSINPOOL; i++) { if((err = pthread_create(&(f[i...
Elena Guidi
1

votes
1

answer
259

Views

JavaFX - Methods creating a new BooleanExpression cause memory leaks

I have just noticed that methods not(), and(), or() from both classes BooleanExpression and Bindings create a new BooleanExpression which probably stays in memory even if it does not have any reference. myBool = new SimpleBooleanProperty(); for (int i = 0; i < 10000000; i++) { myBool.not(); } Aforem...
dpelisek
1

votes
1

answer
329

Views

Does asynchronous code cause 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 exampleM...
user2727195
10

votes
3

answer
324

Views

Can I have memory leaks if I'm not using new keyword?

I'm new to the language and I have a basic doubt about memory leaks. Is it possible to have a leak if I don't use the new keyword? (i.e having my variables in the stack and using data containers like std::vector) Should I worry about this issue? If that is the case, can someone give me an example...
MonkeyCoder
2

votes
1

answer
121

Views

IOSurface gradually increases memory in iOS 12 and above

I am facing memory issue in my app for iOS 12 and above versions. IOSurface gradually increases simultaneously in iOS 12.1.1 where as it works fine in iOS 11 versions. I have attached the issue screenshot below, Why this issue happens in iOS 12 versions? Can someone help me how to solve this? I cros...
Madhavan
5

votes
3

answer
42

Views

What is the “total count” metric in Android Studio's Memory Profiler?

I'm unable to find a description of this metric anywhere in the Android developer documentation. Here is a link to what I've most recently looked at: https://developer.android.com/studio/profile/memory-profiler Here's what I think it is: the number of objects in the heap that have not been deallocat...
Grant Park
1

votes
1

answer
1.1k

Views

WCF Message serialization leaking event handles and unmanaged memory

We have a WCF client and we need to save the request before we send it, however after every serialization there are some leaked windows event handles. We've tried windbg but the handles are created by the clr. Using sysinternals handles.exe reveals that Semaphores and Events are constantly increasin...
Boklucius
1

votes
1

answer
54

Views

What generation to look for when investigating a memory leak?

I doing my first investigating on a potential memory leak likely causing my server to halt. I see the following from the logs: ... 6676.590: [GC [PSYoungGen: 61432K->3902K(65408K)] 343313K->308460K(384896K), 0.0153165 secs] [Times: user=0.07 sys=0.10, real=0.02 secs] 6684.493: [GC [PSYoungGen: 6540...
Pomario
1

votes
2

answer
1.8k

Views

Garbage collection of static variables Java - out of memory

We have an application where we totally cache huge volume of data. The cache is maintained as static maps. Since the data is modified daily by some batch cycles, we refresh the cache after the data is modified. Refreshing cache is done by creating new objects and reference the static variable to t...
karthik2146
1

votes
2

answer
2k

Views

Squashing memory leak caused by using CGPathCreateCopyByTransforming and CGPathCreateCopy

I'm using ARC and a while loop to adjust several CGPathRefs until they fit within some constraints I have, and I need access to the paths once the conditions of the while loop are satisfied. Can someone explain how my code is leaking? The documentation for the CGCreateCopy... functions say they cr...
tobinjim
1

votes
3

answer
109

Views

Do I have to release object in Objective-C [duplicate]

Possible Duplicate: Understanding reference counting with Cocoa and Objective-C I'm little confused with memory leaking - when I have to release object, and when it will be released automatically in iOS, so please help me understood using following code. I have one method with following while block...
Alan 2012
1

votes
2

answer
348

Views

How to demonstrate memory leak and zombie objects in Xcode Instruments?

I would like to demonstrate memory leak and zombie object in Xcode Instruments on a class. I've found it pretty hard to trigger on purpose, especially with ARC turned on. Do you know how could I create them?
itarato
1

votes
3

answer
475

Views

Android/Java object not garbage collected

I am developing a simple pdf reader rewriting an existing example. My app has a custom view with two buttons next and previous. When the next button is clicked it downloads a pdf from the internet and shows it in the view. Each time the next or previous button is clicked the following showPdf() met...
sampath
1

votes
2

answer
2.1k

Views

Out of memory errors on orientation change

I have an app which uses an osmdroid mapactivity. Every time the screen orientation the heap size grows and after a couple of orientation changes I get the following errors: 12-12 00:53:08.990: E/dalvikvm-heap(6712): Out of memory on a 262160-byte allocation. 12-12 00:53:08.990: I/dalvikvm(6712): "f...
sam
1

votes
1

answer
936

Views

Memory leak in setInterval() method

I am creating a javascript based html dashboard. In order to refresh the values in the dashboard charts I have written the following code: var chart, options; function loadDynamicData() { var data = window.parent.getDynamicData(); var dataArray = data.split(','); for(var i = 0; i < chart...
manas
1

votes
1

answer
530

Views

'Memory Full' while transferring large file using QTcpSocket

I'm trying to transfer a large file in a non-blocking fashion, by connecting bytesWritten to my function sendNextBlock. void AsynchronousRetrieveCommand::start() { connect(socket(), SIGNAL(bytesWritten(qint64)), this, SLOT(sendNextBlock())); sendNextBlock(); } void AsynchronousRetrieveCommand::sendN...
sashoalm
1

votes
2

answer
485

Views

Valgrind has reported “memory leak” when I compiled my program with “-pg” enabled?

I've get a memory leak reported by Valgrind with -pg enabled when compiling the following simple code. #include #include #define BOOST_FILESYSTEM_VERSION 3 using boost::filesystem::path; using namespace std; int main() { path ptDir; ptDir = "/home/foo/bar"; if (true == is_directory((const path &)p...
macpaul
1

votes
2

answer
202

Views

iOS app memory leaks after doing Analyze in Xcode 4.5

I'm using Xcode 4.5.2 to practice iOS programming. My app seems to compile just fine, but when I do Product -> Analyze I get the following messages that are better illustrated in a I'd appreciate if someone could explain this to me? PS. I kinda understand what most that does, except the word __brid...
wolfrevokcats

View additional questions