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)

-5
votes
0answers
19 views

OutOfMemory error even though Large bitmaps are handled efficiently [on hold]

I'm developing a tour guide application. I'm using a flipper view for images. I have decoded bitmaps. But it still gives the outofmemoryError. Please help me with this. Thanks in advance 09-01 ...
5
votes
1answer
41 views

File validator configured using XML

I am making an application to check for any files that does not follow a specific pattern defined in a XML file. The application works well, but the source code is not the greatest, and memory ...
0
votes
0answers
33 views

Decrease file size of encrypted file

I am making a Cryptography application and I noticed that the encrypted file is approximately 2 times bigger because I am encoding the files in base64. Are there any file encodings that take less ...
-1
votes
1answer
45 views

Game LevelManager Memory Leak? [closed]

I have a level manager for my game I'm working on, and it's supposed to unload the previous level, and then load the next level. However, when I test it (though I'm not sure I'm testing it right) the ...
5
votes
2answers
118 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
343 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
46 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 ...
5
votes
3answers
91 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
87 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, ...
4
votes
1answer
108 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
56 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
84 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
178 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
385 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
208 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
256 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
95 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
85 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 ...
10
votes
4answers
168 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
139 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
104 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
229 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
115 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
655 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
39 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 ...
7
votes
3answers
435 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
269 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 ...
6
votes
2answers
298 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
422 views

Deallocate all memory in a container of pointers

I want to erase all memory in a container. Currently I'm using this : ...
4
votes
4answers
349 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
62 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
706 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
75 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
146 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
78 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
79 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
49 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
152 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 ...
15
votes
0answers
301 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
333 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
992 views

Alternative to setInterval and setTimeout

Alternative to setInterval and setTimeout JavaScript's setTimeout and ...
11
votes
2answers
191 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
375 views

Conditional jump or move depends on uninitialised value

Please review the following code: ...
1
vote
2answers
106 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
104 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
126 views

split string into container on char; efficiently?

Here is my single parse code for splitting a std::string on a char into a ...
8
votes
1answer
87 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
891 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
135 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 ...