The tag has no usage guidance.

learn more… | top users | synonyms

3
votes
0answers
110 views

Laissez faire memory management [duplicate]

I noticed that various scripting language interpreters leak memory even for very simple programs, like the canonical "Hello world!" program. To illustrate the problem with examples: Perl 5.22 leaks ...
0
votes
2answers
90 views

Does storing a value in a variable uses more RAM than using it directly?

I mean, does something, for example in C#, like String test = "Test"; txtCtrl.Text = test; consumes more RAM than just txtCtrl.Text = "Test"; ? As it's said, a variable is a reserved space in ...
3
votes
3answers
193 views

How much stack usage is too much?

Lately when I've been writing C or C++, I'll declare all my variables on the stack just because it's an option, unlike with Java. However, I've heard that it's a bad idea to declare large things on ...
5
votes
1answer
1k views

Redux memory consumption [closed]

The Redux framework favors immutable state/pure function paradigm, which promotes creation of new state from the previous state in terms of the current action. The applicability of this paradigm is ...
2
votes
2answers
103 views

Code size overhead by including unnecessarily extra header files

I have a program which includes lots of header files but it do not uses all the header files. I have removed some of them although it is working fine. I did not notice any changes in the performance. ...
-4
votes
4answers
213 views

Splitting one class into subclasses to save memory

Suppose that you describe programs, which have a lot of AssignmentStatement(target, /*value*/Expression). There are other statements, like if-statement and for-statement and all of them may have ...
4
votes
1answer
79 views

In SPA what happens in terms of memory and performance when user hops across all the pages?

Imagine a humongous web aplication built using Single Page Application framework such as AngularJS. With its each route it downloads a couple of HTML template files. Each of these template files ...
58
votes
8answers
6k views

If I need to use a piece of memory throughout the lifespan of my program, is it really necessary to free it right before program termination?

In many books and tutorials, I've heard the practice of memory management stressed and felt that some mysterious and terrible things would happen if I didn't free memory after I'm done using it. I ...
2
votes
3answers
140 views

Temporary Variables or Not: Choose CPU Time or RAM? [duplicate]

In a case where multiple variables are set equal to an operation using the result of an other operation, is it best to create a temporary variable for the result of the second operation (this would ...
2
votes
4answers
397 views

When was block scope for variables introduced to C, and why is it still frowned upon?

In light of the recent OBJ_obj2txt vulnerability in LibreSSL (which was found during the OpenSMTPD audit, and does not affect OpenSSL), it came to my attention that the memory leak issue likely ...
-6
votes
1answer
218 views

Using delete this to free memory in class

Whenever we are writing destructors in C++ (though this concept could apply in other languages) could we just not write delete this; and it would delete whatever data is inside of the class? Is ...
2
votes
2answers
1k views

Strategy to avoid running out of memory in memory intensive application

My C# .NET application has to read lots of files with electrical readings. There are several calculation to be done and output files need to be generated. Due to the nature of the input it would be ...
1
vote
2answers
249 views

What is a latency-bound and a memory-bound application in HPC?

I understand that in HPC hybrid systems, for instance a MIC architecture, main memory access is much slower than access to data in own cache or in the cache of another core. I read that HPC MIC ...
1
vote
5answers
6k views

How to share memory between applications written in C/C++

I'm going through a program written in C/C++ for control in robotics. Basically, three different programs run at the same time, and they communicate via shared memory. Google-ling around I found ...
2
votes
1answer
485 views

How much physical memory is consumed by the stack of a .NET thread?

In Stephen Cleary's article in MSDN magazine "Introduction to Async/Await on ASP.NET" he says that "every thread pool thread on a modern OS has a 1MB stack." (modern OS == Windows 7/8 for this ...
1
vote
1answer
97 views

Any advice on how much browser memory to use?

I am writing an angular application, and I'm wondering how much client side memory to use. I'm currently working on a scenario where there are 2 dropdowns. The second will load new values depending ...
1
vote
1answer
243 views

Garbage collection & memory leaks on hash tables

I was reading R. Read's How to be a programmer, and I came accross something I didn't understand: ...even with garbage collection, you can fill up all memory with garbage. A classic mistake is ...
5
votes
3answers
281 views

How to handle a memory consuming member variable

Suppose multiple objects of the same class should do something which takes a memory consuming resource. Which of the following approaches is recommended to define and use the resource by the objects? ...
1
vote
2answers
317 views

Will there be a memory or processing time difference between a class member function and a global function

I'm writing a neuron network simulation program and every operation or additional byte per neuron scales insanely. I prefer C++ as a language over the others, but now I'm wondering if the class ...
0
votes
1answer
191 views

What effect does using multiple childViewControllers views inside a ContainerViewController have on memory?

I have three childViewController views inside my ContainerViewController and these three views are inside a horizontal scroll view. My intention is to build an app that has a custom camera on one ...
2
votes
4answers
201 views

Optimizing code by using registers, but what if they are not enough in number?

One way to optimize code is to minimize the access to arrays and use variables instead, because that way we use registers instead of loading data to cache memory. For example, if in a loop I'm going ...
1
vote
2answers
521 views

Do immutable objects that constantly change impact memory/performance?

I'm writing a program that goes into a loop and keeps changing the state of some models (similar to a game). Naturally, many things are mutable. However, I'm also writing some classes that are ...
3
votes
2answers
101 views

Object identification in Python

In learning Python, I found that when two "names" (or "variables") are assigned to the same value, both of them point to the same memory address. For example >>> a = 10 >>> b = 10 ...
2
votes
3answers
499 views

Understanding how variable assignment works

When I started learning C programming a few years ago, my tutor taught me similar to most of the tutors around the world. She said me the very basic things like any int datatype is of 2 bytes memory. ...
1
vote
1answer
11k views

How to avoid Memory Error

I am working with quite large files (pytables) and I am having problems with the Memory Error when I try to load the data for processing. I would like some tips about how to avoid this in my python ...
2
votes
4answers
485 views

Why is it called a memory leak?

I am a hobbyist programmer, bit of a stickler for terminology, currently learning C and recently came across the concept of Memory Leak. Now, I do understand what it means. Dynamic memory allocated to ...
1
vote
1answer
354 views

Are there theoretical reasons why arrays in C take less RAM than Java?

My experience is that Java requires about twice as much RAM compared to C (comparing char arrays or other comparisons). I also read in a hardware book that Java takes about twice RAM than C. Is is ...
-1
votes
1answer
601 views

Recursion VS memory allocation [duplicate]

Which approach is most popular in real-world examples: recursion or iteration? For example, simple tree preorder traversal with recursion: void preorderTraversal( Node root ){ if( root == null ) ...
0
votes
2answers
430 views

Delphi 7 using RAM for database

I have an existing database app written in D7 with apollo databases. The client has given me a fast desktop with 24gb ram Can I somehow load the database files into ram to speed up processing? With ...
0
votes
2answers
189 views

Is it fine to reuse a class instance?

I ask in terms of high cost classes, with a particle engine as an example. I read somewhere that an instance of a class with a high cost to initialize, like a particle manager, should have its state ...
-1
votes
1answer
184 views

How do memory-clean apps work? [closed]

In terms of operating system architecture, what does a memory-clean software to get rid of all data that fill the virtual memory? I assume that it simply saves all RAM data into a file, but how does ...
3
votes
2answers
415 views

What use is a non-zeroing weak reference?

When reading about the various options for working with things like ARC / GC, I often come across explicit wording about which weak references are zeroing (ie, your reference becomes nil/null/0 when ...
0
votes
1answer
6k views

how much memory should android app use [closed]

We are planning to develop an android application. the application will use API and data transfer will be via SSL. I should write documentation and set functional and system requirements for the ...
0
votes
1answer
131 views

Multiple Instantiate of 1 class affects memory?

I am currently struggling with memory handling. I have an if statement and each case instantiate a new object from a class. Does this affect the memory allocation in java? switch() { case 1: test t1 ...
0
votes
1answer
497 views

Comparing performance of different C++ self-made tree data structures

I have two tree data-structures that I made in C++ , and they give a response for range queries/point queries in that program. I am using Ubuntu. I need help in understanding the way to compare the ...
1
vote
2answers
1k views

Static vs. dynamic memory allocation - lots of constant objects, only small part of them used at runtime

Here are two options: Option 1: enum QuizCategory { CATEGORY_1(new MyCollection<Question>() .add(Question.QUESTION_A) .add(Question.QUESTION_B) ...
1
vote
3answers
206 views

Please help me understand the relationship between script file size and memory usage?

I am programming in PHP and I have an include file that I have to, well, include, as part of my script. The include file is 400 MB, and it contains an array of objects which are nothing more than ...
21
votes
9answers
35k views

What is the point of using lists over vectors, in C++?

I've run 3 different experiments involving C++ lists and vectors. Those with vectors proved more efficient, even when a lot of insertions in the middle were involved. Hence the question: in which ...
0
votes
3answers
2k views

Instruction vs data cache usage

Say I've got a cache memory where instruction and data have different cache memories ("Harvard architecture"). Which cache, instruction or data, is used most often? I mean "most often" as in time, not ...
10
votes
1answer
8k views

How can I improve my application's memory use? [closed]

I am writing a C# application, and can see the memory usage increasing as the running time of the application increases. Are there any tools or techniques I could monitor my application's memory ...
0
votes
4answers
160 views

Acceptable memory usage as a function of input size

I know that if a computation takes linear or linearithmic time based on the size of the input, that's good, and if it takes quadratic time, then that's not so good. However, what about memory usage? ...
4
votes
1answer
1k views

What makes an application memory bandwidth bound?

This has been something that's been bothering me for a while: What makes an application memory bandwidth bound? For example, take this monstrosity of a computer that calculated the 5 trillionth ...