Memory refers to the physical devices used to store programs or data on a temporary or permanent basis for use in a computer or other digital electronic device.

learn more… | top users | synonyms

57
votes
11answers
856 views

Have you dealt with space hardening?

I am very eager to study best practices when it comes to space hardening. For instance, I've read (though I can't find the article any longer) that some core parts of the Mars rovers did not use ...
38
votes
5answers
6k views

Why is CPU cache memory so fast?

What makes CPU cache memory so much faster than main memory? I can see some benefit in a tiered cache system. It makes sense that a smaller cache is faster to search. But there must be more to it.
35
votes
7answers
3k views

In C++, how much programmer time is spent doing memory management

People who are used to garbage collected languages are often scared of C++'s memory management. There are tools, like auto_ptr and shared_ptr which will handle many of the memory management tasks for ...
27
votes
4answers
3k views

Where are null values stored, or are they stored at all?

I want to learn about null values or null references. For example I have a class called Apple and I created an instance of it. Apple myApple = new Apple("yummy"); // The data is stored in memory ...
27
votes
5answers
53k views

Stack and Heap memory in Java

As I understand, in Java, stack memory holds primitives and method invocations and heap memory is used to store objects. Suppose I have a class class A { int a ; String b; ...
25
votes
1answer
625 views

Performance of single-assignment ADT oriented code on modern CPUs

Working in immutable data with single assignments has the obvious effect of requiring more memory, one would presume, because you're constantly creating new values (though compilers under the covers ...
20
votes
5answers
2k views

How did they debug segmentation faults before protected memory?

Now, when I make a programming mistake with pointers in C, I get a nice segmentation fault, my program crashes and the debugger can even tell me where it went wrong. How did they do that in the time ...
16
votes
4answers
4k views

Is it possible to read memory from another program by allocating all the empty space on a system?

Theoretically, if I were to build a program that allocated all the unused memory on a system, and continued to request more and more memory as other applications released memory that they no longer ...
14
votes
6answers
940 views

Term for 24-bits

Is there a term for a 24-bit (3-byte) integer? I know uncommon bit counts (such as a "nibble" or "nybble" for 4 bits) have names, and having 24-bits in both video and audio technology, for instance, ...
14
votes
5answers
13k views

Why does IIS default to Recycling the Application Pool every 1740 minutes?

Why does IIS default to recycle the app pool after a given time? Is there some specific reason other than perhaps most web apps are not managing the memory prudently? Given that you are managing your ...
13
votes
3answers
6k views

What are CPU registers?

This question has been bothering me for some time now and today I figured I would Google it. I've read some stuff about it and it seemed very similar to what I've always known as processor cache. Is ...
12
votes
11answers
1k views

Could it be more efficient for systems in general to do away with Stacks and just use Heap for memory management?

It seems to me that everything that can be done with a stack can be done with the heap, but not everything that can be done with the heap can be done with the stack. Is that correct? Then for ...
12
votes
1answer
629 views

How important it is to fix memory leaks?

I found by Valgring that some GTK+ programs leaks memory. How important it is to fix those leaks? I mean, often those programs works very well but on the other hand, one can never be sure if one wants ...
12
votes
3answers
646 views

Debugging memory corruption

First off, I do realize this is not a perfect q&a style question with an absolute answer, but I can't think of any wording to make it work better. I don't think there is an absolute solution to ...
11
votes
11answers
748 views

Infinite Bitmap

I'd like to build a bitmap during runtime. The bitmap should be scalable on all sides and pixel access should be quiet efficient. Between and after the commands shown in the picture, Map.setPixel() ...
10
votes
3answers
2k views

Choose C++ or Java for applications requiring huge amounts of RAM? [closed]

I'm thinking of scientific applications that are mostly processor-bound and heavy on heap usage (at least several gigabytes). Any other time of the year I would happily go with C++, but in this case I ...
10
votes
2answers
1k views

Haskell memory efficiency - which is the better approach?

We are implementing a matrix compression library based on a modified two dimensional grammar syntax. Now we have two approaches for our data types -which one will be better in case of memory usage? ...
10
votes
4answers
8k views

How can I monitor the JVM memory in a proper way?

I'm thinking of how we do JVM memory monitor in a low overhead way in production environment even under busy hour. Suppose I have two tomcat app server in production, load balance set up behind them. ...
9
votes
4answers
2k views

Analyzing Memory Usage: Java vs C++ Negligible?

How does the memory usage of an integer object written in Java compare\contrast with the memory usage of a integer object written in C++? Is the difference negligible? No difference? A big difference? ...
8
votes
3answers
378 views

Object Identity and Mutability

I was reading a proposal for value types in Java, and I came across this sentence: "Object identity serves only to support mutability, where an object’s state can be mutated but remains the same ...
8
votes
2answers
443 views

Is there a comparative study of the memory consumption of programming languages runtimes, correlated with expressiveness and production bug ratios? [closed]

There are many comparative studies and available online when it comes to the runtime performance of applications built using one language or another. Some driven by corporations, some academic, some ...
8
votes
1answer
352 views

Why is the main memory for object allocation called the 'heap'?

Has anybody got an idea why the area of main memory where objects are allocated is referred to as the heap. I can understand the rationale for that of the stack LIFO but would like to know what the ...
7
votes
4answers
672 views

Why not free memory as soon as its reference counter hits zero [duplicate]

A lot of languages like Java and C# have garbage collectors that free memory when that memory no longer has any reference. Yet they don't immediately free it after the reference counter hits zero but ...
7
votes
5answers
3k views

Do threads use virtual memory or real memory?

I was trying to optimize my Linux server to handle 10,000 threads per process while it does just 382 right now. As per this article the following formula is used to find out total possible threads: ...
7
votes
2answers
204 views

Autoreleasing objects in Reference Counting Systems

I'm experimenting a bit in C and I'm trying to implement my own Reference Counting System. I've mainly worked with Objective-C in the past but AFAIK autoreleasing objects is something that is unique ...
7
votes
3answers
568 views

Why isn't DSM for unstructured memory done today?

Edit: Comments suggested, that DSM just faded out by being not used recently. What were the reasons for this, what are DSMs drawbacks? Literature lists many positive aspects like easy to port ...
6
votes
5answers
475 views

On mobile is there a reason why processes are often short lived and must persist their state explicitly?

Most mobile platforms (such as Android, iOS, Windows phone 7 and I believe the new WinRT) can kill inactive application processes under memory pressure. To prevent this from affecting the user ...
6
votes
2answers
4k views

How are the size of the stack and heap limited by the OS?

Note: if you need to consider a specific OS to be able to answer, please consider Linux. Whenever I run a program, it will be given a virtual memory space to run in, with an area for its stack and ...
6
votes
6answers
710 views

Demonstration of garbage collection being faster than manual memory management

I've read in many places (heck, I've even written so myself) that garbage collection could (theoretically) be faster than manual memory management. However, showing is a lot harder to come by than ...
6
votes
1answer
194 views

Does assigning NULL in a GC'ed Environment have similar effects to using free()?

I was just writing a function (in C# in this case) that stored huge amounts of data in a local variable early on in the code, let's say at 5% of the functions code. After that point, the data in this ...
6
votes
2answers
6k views

Java vs PHP Memory / CPU Consumption

I work in a PHP based company. There is a project where we want to create a backend service. Senior members here are going for PHP, even though it is slower than Java. Their only point of contention, ...
6
votes
2answers
369 views

Are there alternatives to stack+heap+static memory model?

All programs I have seen organize their data memory into one or more call stacks (usually fixed size, but sometimes not), the heap, and static memory. Lately thread-local static storage has been ...
5
votes
6answers
2k views

Addressable memory unit

From Wikipedia: the term endian or endianness refers to the ordering of individually addressable sub-components within a longer data item as stored in external memory (or, sometimes, as ...
5
votes
3answers
806 views

Tension between the dependency inversion principle and avoiding “new” in C++?

I have seen a lot of advice that it is better to do Type object; than Type* object = new Type(); in C++ whenever possible—i.e., minimize your use of new. I understand the rational behind this and ...
5
votes
2answers
2k views

What are the pros and cons of Inter process communication done via sockets vs shared memory?

I understand that two of the many more options for inter process communication can be : Shared memory Sockets Actually I saw these two options being exposed by Intellij Idea for debugging a Java ...
5
votes
1answer
3k views

Why the overhead when allocating objects/arrays in Java?

How many bytes an array occupies in Java? Assume It's a 64bit machine and also assume there are N elements in an array, so all these elements would take up 2*N, 4*N or 8*N bytes for different types of ...
5
votes
3answers
1k views

How would one go about reading memory from a process? Is it different by OS?

As an experienced web-developer, but a novice "low level" programmer, this stuff is sort of voodoo to me still. I'm curious about how one would even begin to go about finding a memory block, and then ...
5
votes
1answer
164 views

At ping, why do we have to do array copying instead of passing on the source array that the client sent to us?

So I have been googling about this OpenSSL heart-bleed thing and somehow sees that it is caused by the heartbeat extension which requires client to ping the server to show its aliveness and it all ...
5
votes
2answers
2k views

Custom heap allocators

Most programs can be quite casual about heap allocation, even to the extent that functional programming languages prefer to allocate new objects than modify old ones, and let the garbage collector ...
5
votes
3answers
2k views

Methods to share memory or state across JVMs?

This is long question I know. I have a few options for what I want. I don't want to know "this is obviously the best," but maybe any pros or cons I may be missing about the options, as well as any ...
4
votes
2answers
221 views

Evaluation order of expressions in Clojure?

I'm currently learning Clojure (my first functional programming language), and I'm curious as to its order of evaluation. Here is an example: (take 10 (cycle [1 2 3])) If the cycle expression was ...
4
votes
2answers
907 views

Smart Pointers inside class vs Normal Pointers with Destructor

Regarding pointers which are members of classes. Should they be of a smart pointer type or is it enough to simply deal with them in the destructor of the class they are contained in?
4
votes
5answers
699 views

The Default State of Unused Memory

In an embedded device, during the initializing of memory locations, is there any convention that are being practiced. I mean, say setting every byte to zero or 0xFF or any other value.
4
votes
5answers
798 views

Java memory management (thunks/lazyness)

If I want to create an infinite list of integers in Java like so: ArrayList<Integer> list = new ArrayList<Integer>(); for(int i = 0;;i++){ list.add(i); } I run out of memory. My ...
4
votes
1answer
324 views

Writing a spell checker similar to “did you mean”

I'm hoping to write a spellchecker for search queries in a web application - not unlike Google's "Did you mean?" The algorithm will be loosely based on this: http://catalog.ldc.upenn.edu/LDC2006T13 ...
4
votes
1answer
413 views

Does having more classes necessarily increase the memory requirements of the app?

When we add .edmx files to a DLL, the physical size of the DLL increases. DLL's are loaded into memory. However, the .NET infrastructure with functionality such as JIT compilation and the GAC ...
4
votes
4answers
494 views

Manual memory allocation and purity

Language like Haskell have concept of purity. In pure function, I can't mutate any state globally. Anyway Haskell fully abstracts memory management, so memory allocation is not a problem here. But if ...
4
votes
3answers
136 views

Using “prevent execution of method” flags

First of all I want to point out my concern with some pseudocode (I think you'll understand better) Assume you have a global debug flag, or class variable named "debug", class a : var debug = ...
4
votes
1answer
295 views

What are the benefits of Android way of “saving memory” - explicitly passing Context objects everywhere?

Turned out, this question is not easy to formulate for me, but let's try. In Android, pretty much any UI object depends on a Context, and has defined lifetime. Android can also destroy and recreate UI ...
4
votes
3answers
464 views

Multiple sites with the same codebase in Python

I am trying to run a large amount of sites which share about 90% of their code. They are simply designed to query an API and return the results. They will have a common userbase / database but will be ...