memory-leaks

What is dirty private memory?

橙三吉。 提交于 2019-12-22 05:23:08
问题 I'm developing an application on a 64-bit Linux system. As I could see, my app is eating too much dirty heap memory. Talking about the heap memory, what does "dirty" mean? What makes it arise and what can be done to prevent it to arise? EDIT I'd better explain what operations my application performs. My application runs in two threads: the first thread sends jobs to a queue which are then executed in another thread. So, the first thread allocates pages to be queued and the second thread

strdup() memory leak even after free()

☆樱花仙子☆ 提交于 2019-12-22 05:17:11
问题 I've never needed to use strdup(stringp) with strsep(&stringp_copy, token) together until recently and I think it was causing a memory leak. ( strdup() has always free 'd just fine before.) I fixed the leak, and I think I understand how, but I just can't figure out why I needed to. Original code (summarized): const char *message = "From: username\nMessage: basic message\n"; char *message_copy, *line, *field_name; int colon_position; message_copy = strdup(message); while(line = strsep(&message

Memory leak using TensorFlow for Java

喜你入骨 提交于 2019-12-22 05:08:14
问题 The following test code leaks memory: private static final float[] X = new float[]{1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0}; public void testTensorFlowMemory() { // create a graph and session try (Graph g = new Graph(); Session s = new Session(g)) { // create a placeholder x and a const for the dimension to do a

Understanding gc.get_referrers

我与影子孤独终老i 提交于 2019-12-22 04:58:44
问题 I'm trying to track a memory leak in Python (2.7). I've found gc.get_referrers, but don't understand the output. After deleting dying_node (which should get rid of all references except for a list that I've created as part of my hunting), I have in my code: gc.collect() print "done dying: ", getrefcount(dying_node) #note, includes the reference from getrefcount referrers = gc.get_referrers(dying_node) print "referrers: " for referrer in referrers: print referrer which yields the output: >

Memory Leaks - STL sets

一世执手 提交于 2019-12-22 04:39:09
问题 I am trying to plug up all my memory leaks (which is massive). I am new to STL. I have a class library where I have 3 sets. I am also creating a lot of memory with new in the library class for adding info to the sets... Do I need to deallocate the sets? If so, how? Here is the library.h #pragma once #include <ostream> #include <map> #include <set> #include <string> #include "Item.h" using namespace std; typedef set<Item*> ItemSet; typedef map<string,Item*> ItemMap; typedef map<string,ItemSet*

Are There Memory Issues with Ext.js

99封情书 提交于 2019-12-22 04:36:16
问题 The UI for an application I work on was recently redone with Ext.js and I have noticed the memory usage of IE seems very large when viewing it. Are there known memory issues with Ext.js when using IE? 回答1: The first thing that jumps out at me in your question is that you are seeing this in IE. My team recently went through the same issue (Extjs on IE). It turns out Ext is not the culprit but rather IE is likely the cause. A quick Google for 'IE closure memory leak' will find you plenty of

H.264 Frames Memory Leak With Some Decoders

不羁的心 提交于 2019-12-22 04:34:42
问题 I'm receiving an H.264 stream from a DVR using its SDK. There were memory leaks and i thought it was the SDK causing all the leaks. But when i recorded the stream and played the frames one by one reading from the disk (without any 3rd party dlls involved), i noticed that the problem is not the dll but the stream itself. Strange enough, DivX H264 Decoder is the only codec which doesn't cause a memory leak but when the stream runs for a long time, sometimes DivX decoder crashes as well. I'd

Is using StringBuilder Remove method more memory efficient than creating a new StringBuilder in loop?

爱⌒轻易说出口 提交于 2019-12-22 04:32:27
问题 In C# which is more memory efficient: Option #1 or Option #2? public void TestStringBuilder() { //potentially a collection with several hundred items: string[] outputStrings = new string[] { "test1", "test2", "test3" }; //Option #1 StringBuilder formattedOutput = new StringBuilder(); foreach (string outputString in outputStrings) { formattedOutput.Append("prefix "); formattedOutput.Append(outputString); formattedOutput.Append(" postfix"); string output = formattedOutput.ToString();

How to get .NET to uncommit unused RAM?

夙愿已清 提交于 2019-12-22 04:15:13
问题 Here are the stats for my program after it used memory extremely intensively, consuming 6 GB at its peak, but then saving everything to disk and leaving very little in scope: Observe that almost everything has gone out of scope and has been garbage collected - the heap sizes are tiny. And yet, .NET keeps 181 MB committed . I don't mind the reserved bytes, since that only consumes address space. But the committed memory is annoying – even if it only resides in the page file, it's still quite a

node.js - possible http server memory leak

匆匆过客 提交于 2019-12-22 04:02:13
问题 Nodejs version: 0.8.8 Here is the server: var http = require('http'); var port = 1338; var ip = "127.0.0.1"; http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hi there\n'); }).listen(port, ip); Client (php script) curls away a post request to the above server. POST is a string (json), about 4 megabytes in size. As you can see, server does nothing with the posted data. In order to debug, I removed all my code and went back to the hello world