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

3
votes
2answers
85 views

How to manage memory in C interface for C++ implementation considering c++11?

I have a library implemented in C++ which has a C interface. This C interface is, for all intents and purposes, the only way to use this library. C++11 seems to discourage the use of raw pointers but ...
0
votes
1answer
39 views

Worried about memory leak in DLL that creates a dynamic sized array

I have a wrapper DLL that interfaces to another DLL that contains the following function: char * Foobar(void) { // BLAH is the function from the DLL this wrapper interfaces too char *array ...
3
votes
2answers
163 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 ...
0
votes
0answers
15 views

streaming data in memory aggregation

We have a stream of data we're aggregating stats over and putting into a python dictionary (sent from kafka). Every X time interval, We update our database with these aggregated metrics. This ...
0
votes
2answers
39 views

Multi-level paging tables

Referring to the image here: From http://en.wikipedia.org/wiki/File:X86_Paging_4K.svg Could somebody please explain something for me? I don't get exactly how this works. As I understand it the ...
37
votes
5answers
5k 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.
-1
votes
1answer
106 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 ...
0
votes
3answers
92 views

Advantage of monitoring file change using Windows API rather than manually

I developed a Windows software about an year ago. Part of it was to monitor few configuration files for manual changes by user and if any of these change restart a particular service. So, I used the ...
1
vote
1answer
236 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 ...
1
vote
0answers
73 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. It also can destroy and recreate UI ...
5
votes
2answers
282 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 ...
7
votes
4answers
579 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 ...
2
votes
2answers
464 views

Help me think in C++

I mainly use dynamic languages. For many years I see statically typed hello world examples like const int STACK_SIZE = 100; And I will think "wow, I can't think like that". I understand memory ...
2
votes
1answer
242 views

How does the CPU know when it received RAM data and instructions?

Well, the title is pretty much self explanatory, but I'll expound it a bit, and say the origin of my question. So, I've been wondering as to how the CPU knows when it received the RAM. I'm pretty ...
0
votes
1answer
103 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 ...
2
votes
4answers
454 views

Why do we use to talk about addresses and memory of variable in C?

Why do we use to talk about addresses and memory of variable in C, where in other languages (like in Java, .Net etc) we do not talk about variable address and memory in a program, we will directly use ...
0
votes
2answers
595 views

Can anyone explain representation of float in memory?

This is not duplicate question as I read the previous question. Can anyone help me in understanding how float values are stored in the memory . My doubt is here float values contain '.' (for example ...
-1
votes
2answers
85 views

Applications affected by memory performance [closed]

I'm writing a paper on the topic of applications affected more by memory performance than processor performance. I've got a lot written regarding the gap between the two, however I can't seem to find ...
12
votes
1answer
586 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 ...
4
votes
0answers
292 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 ...
1
vote
1answer
1k views

External sqlite db file from sdcard in android

I just searched for the same but didn't get the answers. What I have is a db file which is around 100MB. I have saved the db file in sdcard . Through this db file I'm going to populate the contents ...
0
votes
1answer
155 views

Will having ClassA extend ClassB slow down my runtime performance compared to having classC which contains all the members of ClassC?

I have a class with a lot of methods. I would like to group similar methods together in their own class, but all of the methods need to extend another class, ClassC. So I was thinking of having ...
11
votes
3answers
2k 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 ...
3
votes
2answers
286 views

Methods to identify and resolve memory leaks in the JVM

As the data is migrated via the object level, there has been a slow upwards trend in memory usage. I can see the periodic gc activity, but the memory trend is still going up slowly. I have currently ...
4
votes
1answer
372 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 ...
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? ...
4
votes
2answers
2k 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 ...
2
votes
2answers
484 views

Flat addressing vs. segmented addressing

Is flat addressing model generally superior to a segmented one? If so, why? If not, what instances would call for each over the other and why? My understanding of memory models surrounds the ...
2
votes
2answers
377 views

What is the best solution for static memory allocation?

I'm working on image processing and I need to use big Images in a critical system. A good practice for critical systems is to avoid dynamic allocation of memory but what is the design/recommendations ...
1
vote
1answer
169 views

Improving the efficiency of containers with dynamically allocated objects

This is not strictly related to C++ but its type system serves to illustrate the problem well. Assume: We have a generic template Container<T> (such as a std::vector<T>) which stores an ...
5
votes
5answers
439 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 ...
2
votes
1answer
102 views

Handling Dynamic amount of Strings for persistent and runtime storage in an IOS App

Background I am dynamically building an FQL query statement and because of the nature of the app, I exclude FB family members, this is the base portion of the query and remains fairly static. The ...
2
votes
1answer
133 views

Is every object rounded to the same size in Java?

According to this answer every object in Java is of the same size? Is the answer talking about the object itself or the reference to the object? Here's the statement: every object size is rounded ...
7
votes
2answers
320 views

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

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 ...
19
votes
5answers
1k 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 ...
0
votes
0answers
49 views

Object pooling in managed environments

My application tries to process chunks of data, each sized at tens of megabytes, but not fixed size. I use a producer for data fetching, and consumer for data processing, Since I do not control the ...
24
votes
1answer
580 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 ...
2
votes
4answers
273 views

Architecture change from using disk to RAM to read and write key/value pairs coming over a network

A WebApp writes a stream of data coming over a network to disk as key/value pair and then reads & send it over network again after few milliseconds in 99% of case. In 1% of cases write/read can be ...
3
votes
2answers
652 views

How many `malloc` calls is too many? If any?

I'm implementing a system in C, implemented partially as a library. The library does most of the memory management itself, with the application layer just having to call *_destroy functions on the ...
2
votes
4answers
246 views

Should I read a chapter about Memory management if now a days we mostly use ARC?

I'm reading a book on Objective C, and I was wondering about 2 things: Should I take the time currently to read a whole chapter on memory management? If you are doing a really good job on manual ...
6
votes
2answers
3k 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, ...
4
votes
3answers
1k 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 ...
1
vote
3answers
167 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 ...
2
votes
6answers
208 views

Deterministic and controllable fully automated memory management

Fully automated memory management increases productivity and integrity greatly, but usual implementation (GC) has a critical problem. It's non-deterministic, and not controllable. This causes many ...
8
votes
1answer
317 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 ...
3
votes
2answers
326 views

Purpose of Base Address?

What's the purpose of a base address in an executable? For example, in Microsoft Visual C++'s linker, you can set a base address, or use the default of 0x1000000. But with virtual memory, why would a ...
3
votes
5answers
554 views

Given that I voluntarily choose not to implement virtual memory in my kernel, how would the memory-management-unit work?

For my basic kernel I refuse to implement the dreaded confusion of virtual memory scheming, so I want only real memory addresses for everything. Some people have argued with me that since virtual ...
4
votes
5answers
686 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 ...
2
votes
2answers
1k views

Can multiple CPU's / cores access the same RAM simutaneously?

This is what I guess would happen: If two cores tried to access the same address in RAM, one would have to wait for the other to access the RAM. The second time that each core would try to access ...
5
votes
2answers
1k 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 ...