Questions tagged [memory-management]

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.

Filter by
Sorted by
Tagged with
2
votes
1answer
322 views

Runge-Kutta 2nd order of differential equations

Could I improve this somehow (not numerically, just C-wise)? Do I need to allocate the array since I am returning it and not just using it inside the function? ...
11
votes
3answers
1k views

Reusing strings read from I/O

I am working on an application that reads lots of data from the network and puts it in a grid. I noticed that I could save some memory by reusing existing strings instead of always using the new ...
4
votes
2answers
198 views

Array initialization from text string

I have a block of text where several arrays are printed out, with a name and values: VAL1=10 20 30 40 50 VAL2=4 8 15 16 23 42 I have a function that looks for the value name, and sets an ...
7
votes
1answer
715 views

Double-Ended Queue - Have I over-engineered it again?

I'm working on an implementation of the Double-Ended Queue as a Doubly-Linked List (for personal enrichment), and I was wondering if anyone minded taking a look at my Constructor/Destructor and Empty ...
3
votes
1answer
330 views

My program spikes from 100,000K mem to 1,000,000K mem in a matter of minutes in my program in VB.net [closed]

I've created a program that uses System.Graphics to render a simple (small) 2D scene to the screen. The problem is, for some reason, it starts to quickly ...
1
vote
2answers
323 views

NSAutoreleasePool with Json Data

Just need to know if I'm doing something wrong in this code. my app seem work fast now with this code. I just want to if i really understant that ...
5
votes
1answer
213 views

Overloading the new operator

This may be a naive question, but what are the dangers of the following code (allocate more memory in the new operator for the info struct)? ...
3
votes
1answer
1k views

Does this I/O operation caused a memory leak [closed]

My colleague did some code Optimise work. Code below is from a public method of a public class (NOT STATIC CLASS OR METHOD) code before: ...
3
votes
1answer
1k views

Memory leaks in lottery simulator

I'm primarily a C++/Java programmer, but I've recently started using Python at work and decided to write a Lottery Simulator at home. I wrote it to test out different combinations of lottery numbers ...
8
votes
2answers
2k views

BitTorrent peer protocol messages

I'm writing a BitTorrent client. Part of the protocol is an exchange of length-prefixed messages between peers. The forms of these messages are described in the official specification and also in the ...
1
vote
1answer
597 views

Memory Question

Can this part of a view controller subclass be checked for memory leaks. I am not that good at finding leaks. I need this class to be able to be loaded many time over without it crashing due to memory ...
3
votes
0answers
1k views

Integrating SFML and Box2D lib, and a Mass Production Shape Factory

I've just written two new headers: one that integrates Box2D and SFML by a class called BodyRep which creates/ is a graphic representation of any body, and one that ...
8
votes
1answer
490 views

Use of external memory or a custom allocator

I'm creating a class which uses a custom buffer. I want to offer the possibility to pass an external memory address (for higher interoperability between languages) or (for convenience) to specify a ...
4
votes
2answers
3k views

Allocating memory for a matrix with a single malloc

For an interview, I was asked to write code allocate memory for a rows*cols matrix, using a single malloc(). I want your comments about this code that I wrote: <...
2
votes
2answers
2k views

Subclassing UIButton

I need to subclass UIButton, however the design of UIButton makes this really painful. This is because to create a button you ...