Memory management is the act of managing computer memory by allocating portions of memory to programs as well as freeing memory so that it can be re-used.

learn more… | top users | synonyms (1)

0
votes
0answers
11 views

Memory Leak happening when using static instance of GsonBuilder to create Gson instances [migrated]

I am usong Google's excellent Gson library for doing JSON (de)serialization. I am making use of the GsonBuilder class to create ...
5
votes
2answers
97 views

Singleton Typed Memory Manager

For my resources management, I wanted the objects allocated on the heap to be in a contiguous block of memory. Obviously, each data type then has to have their own chunk of memory. I could have used a ...
7
votes
3answers
336 views

Hierarchical k-ary tree in C without relying on RAM

I created a k-ary tree in C to be used as an easy and efficient way to organize "UML-like" data in embedded devices. The left node is at the lower logical level (a child) while the right node is at ...
6
votes
1answer
40 views

Possible memory leak in a for loop macro

I was reading about similar problems to the one I am having, and my guess is that I am having a 'memory leak'. I'm not sure exactly what that means, or how to correct it. Could you take a look at my ...
3
votes
3answers
72 views

CSV demographics analyzer seems to waste memory/move slowly

I'm much more fluent in JS, but I needed to sort a lot of dates, ages, genders, etc. from a tab-delimited text file so I wrote this. Could I get some tips on how to make this more efficient and more ...
1
vote
1answer
55 views

Image upload and thumbnail creation script using PHP GD

Ignoring my shocking use of the mysql_* extension (and any associated issues), could you take a look at my script that uploads an image, adds it to a database, ...
3
votes
1answer
83 views

Maintaining a car collection list in a multithreaded application

I have a multithreaded application for web scraping from an automobile website. While performing web scraping, there are many links that gives the same result, so I have to check for data redundancy. ...
2
votes
0answers
53 views

Code elimination once it is conditionally dead [closed]

A situation when programming code becomes dead dynamically or conditionally, such as here in this scenario. I don't want my code to be failure victim of branch prediction. ...
4
votes
1answer
64 views

Permutations program in Python

This code asks for letters and a number of letters per word and generates all possible permutations. Then compares those permutations with an English dictionary and creates a list with all the words ...
8
votes
3answers
160 views

Travelling Salesman in Qt

I am writing a recursive function based on the Travelling Salesman Problem. Is this a correct way of doing things, or am I creating memory leaks? Prerequisites are: a two dimensional matrix ...
6
votes
2answers
383 views

Stack challenge - improving memory consumption

I am working on this problem: Stacks Imagine, that you are employed by a software development company. You work now on the famous "D++ project", which is devoted to the creation of a new ...
5
votes
3answers
201 views

Program falls over with larger input files

I have been translating a solution from C# into VB.Net, because I know more VB and wanted to understand it better. I have a version up and running that replicates the C# performance with small input ...
2
votes
2answers
253 views

Counting occurrences of Char8s in a file

To learn some Data.Map and Control.Monad.State, I have written the following code, which should count the occurrences of ...
2
votes
0answers
72 views

Possible memory leak with WPF Custom Control?

I might have a potential memory leak with my custom control. Do I actually have one? ...
2
votes
1answer
80 views

Checking for memory leaks in data structures

I'm looking for a code review for my JavaScript code that checks if there is any memory leaks in data structures. Please include constructive criticism, as well as details on what I can do to make ...
9
votes
4answers
150 views

Bare-bones string library

After years of criticizing others, I've finally found the time and worked up the courage to polish up one of my bits of code and solicit criticisms of my own. This is a simple dynamic-string library ...
4
votes
1answer
52 views

Allocating memory and releasing the same [closed]

I was going through a code snippet... ...
3
votes
2answers
101 views

Java Manual-Reference-Counting

I have a Java game development framework. Certain classes, such as Texture, need to be disposed as soon as you don't need them - we cannot depend on the Garbage ...
3
votes
1answer
88 views

Auto-recycling C++11 polymorphic smart pointers

I've recently read an interesting blog post by Philipp Zschoche: it explains how it's possible to avoid unnecessary allocations/deallocations by keeping track of previously allocated memory in a ...
3
votes
2answers
209 views

Slow data-processing and inefficient memory usage in .NET containers

I am writing a text classifier and in order to do so I need TF/IDF values per every word of my signle text. Then I need to use the cosine similarity: \$similarity = cos(\theta) = \dfrac{A \cdot ...
2
votes
2answers
99 views

Fastest / most efficient random bit indexing in Python

Using Python/Cython, I am trying to construct an efficient way to index boolean values. I have been trying to use the bitarray and/or bitstring packages to construct a fast, non memory intensive way ...
4
votes
1answer
315 views

Hackerrank Gem Stones

I am working on some problems on Hackerrank. John has discovered various rocks. Each rock is composed of various elements, and each element is represented by a lowercase Latin letter from 'a' to ...
1
vote
0answers
33 views

Memory leak with ARM7 core? [closed]

I'm programming ARM Cortex-M3 microcontroller. I try to implement message que. Messages are added into que inside interrupt ...
6
votes
3answers
316 views

Get distinct combinations of numbers

The below code returns all distinct combinations based on the logic that 1,2,3 = 3,2,1 = 2,3,1, so it only returns 1 instance of that set of numbers. ...
3
votes
1answer
207 views

Will this class leak memory using unique_ptr, normal pointer, vectors and strings? [closed]

I haven't used C++ for a while, and have been reading more about the C++11 version. I'd like to verify what I know about C++ memory management is correct. Headers removed for simplicity. MyClass.h ...
5
votes
2answers
182 views

STL Stack Implementation

I implemented std::stack from the STL for deeper understanding of the language and memory since I still am only a beginner. I implemented the stack using a singly ...
7
votes
2answers
404 views

Deallocate all memory in a container of pointers

I want to erase all memory in a container. Currently I'm using this : ...
3
votes
4answers
246 views

Creating a custom Vector class

I'm new to C++ and am doing the C++ 4th Edition Stroustrup book. I expanded on one of the examples, and have a few questions to ask (embedded within the code: ////QUESTION 1-9). Please provide any ...
2
votes
0answers
58 views

Associative container that produces a unique, instance specific handle for each inserted object

It is not always possible to simplify program design by strictly managing the lifetimes of objects. If two objects have unpredictable lifetimes, but one of them needs to refer to the other, a simple ...
5
votes
2answers
473 views

How to optimize for larger files: MemoryError in Python while combining multiple JSON files and outputting as single CSV

I have a number of JSON files to combine and output as a single CSV (to load into R), with each JSON file at about 1.5gb. While doing a trial on 4-5 JSON files at 250MB each, I get the following ...
2
votes
0answers
67 views

Optimization Algorithm: Too much memory consumed

What I have here is an implementation of an optimization algorithm called the covariance matrix adaptation evolutionary strategy. I am using this algorithm to optimize the position of wind turbines ...
4
votes
1answer
106 views

Handling of memorystream with streamwriter efficiency

My little program I'm working on generates charts (GUI) and (on another tab) lists the values my chart is fed from. ...
4
votes
2answers
72 views

Handle-based entity manager (that stores entities contiguously)

EDIT: The code and the algorithm have been improved. Check out my own answer below for the updated files. I've created a generic data structure intended for game development entity management. It ...
3
votes
1answer
74 views

Traversable memory pool

I wrote this memory pool as a code sample for a job interview. It provides a per-class memory pool that can offer faster runtime performance for classes that need to be traversable and (de)allocatable ...
3
votes
2answers
42 views

Simple memory pool using no extra memory

I've borrowed the idea from the internet and I would like to know if my implementation is all right and what could be improved. It uses the free memory to store links to each node, so there's no ...
10
votes
2answers
137 views

Image handling class

Let me start by saying that I am very happy with this code. I want to share it with other people because I think they will find it helpful, but I want to make sure I did everything in good form ...
13
votes
0answers
243 views

Yet another 'any' class implementation, named 'some'

This is a follow-up of 'any' class implementation. After posting my answer, I kept working on the code towards parameterizing with respect to memory management as I had promised. I ended up in some ...
4
votes
3answers
331 views

How do I avoid over-using the garbage collector?

I'm wondering what the best way of initializing variables so that I don't over use the garbage collector with a for-loop. Assuming the variable is only used inside ...
5
votes
1answer
668 views

Alternative to setInterval and setTimeout

Alternative to setInterval and setTimeout JavaScript's setTimeout and ...
11
votes
2answers
171 views

Free a binary tree without using recursion or allocating memory

As the title says, the objective is to free a binary tree without using the stack or allocating memory. This was required for a kernel module where resources were limited. Result has a complexity of ...
6
votes
2answers
277 views

Conditional jump or move depends on uninitialised value

Please review the following code: ...
1
vote
2answers
94 views

Capture and assign portions of char array to a struct

I am formally a PHP/C# developer and I am new to C. I need you to help to correct my coding with C. I have a kind of following pieces of HTTP user data string. ...
4
votes
1answer
97 views

My HangMan Game

I have been trying to learn C by making a Hangman game. It's not perfect, but with C, I worry that my coding practices will not be very good. I'm also new to allocating memory myself, so I feel I ...
2
votes
2answers
101 views

split string into container on char; efficiently?

Here is my single parse code for splitting a std::string on a char into a ...
4
votes
0answers
62 views

Does this simple memory pool use too much memory?

I just wrote this pool to avoid calling malloc and free when I have some code that frequently allocates and deallocates chunks ...
2
votes
2answers
660 views

Gridview shuttering when scrolling

I have more than 1000 items in my GridView. When scrolling though, it appears to make the app 'shutter'. Each time I load images from Picasso GC, it increases. ...
3
votes
0answers
115 views

Smart pointer memory pool

I'm using a third-party library which utilizes boost::shared_ptr for memory management. The problem is that I need to allocate many objects and I have detected ...
4
votes
0answers
113 views

D3D9 leaks if any?

I am writing a D3D9 hook plugin to give back to a community that helped me learn programming. It is a community based on programming and scripting for games. The plugin is supposed to hook d3d9.dll ...
8
votes
1answer
220 views

NSInvocation Implementation

I'm using NSInvocation as a choke point in my app to help manage threading and reduce the amount of redundant code. The purpose of this class is to pass arguments ...
6
votes
4answers
166 views

Pass pointer data across multiple functions

I would like review on the following dynamic memory allocation process and suggestions on whether there are any memory leaks. Following code is not real code in use, but I'm trying to understand ...