Questions tagged [ram]

RAM (Random Access Memory) is a form of computer data storage. A random access device allows stored data to be accessed in very nearly the same amount of time for any storage location, so data can be accessed quickly in any random order.

RAM (Random Access Memory) is a form of computer data storage. A random access device allows stored data to be accessed in very nearly the same amount of time for any storage location, so data can be accessed quickly in any random order.

The two main forms of modern RAM are static RAM (SRAM) and dynamic RAM (DRAM). In static RAM, a bit of data is stored using the state of a flip-flop. This form of RAM is more expensive to produce, but is generally faster and requires less power than DRAM and, in modern computers, is often used as cache memory for the CPU.

Both static and dynamic RAM are considered volatile, as their state is lost or reset when power is removed from the system. By contrast, Read-only memory (ROM) stores data by permanently enabling or disabling selected transistors, such that the memory cannot be altered.

2294 questions
45
votes
3 answers

Limit RAM usage to python program

I'm trying to limit the RAM usage from a Python program to half so it doesn't totally freezes when all the RAM is used, for this I'm using the following code which is not working and my laptop is still freezing: import sys import resource def…
Ulises CT
  • 1,361
  • 1
  • 12
  • 21
40
votes
9 answers

get server ram with php

Is there a way to know the avaliable ram in a server (linux distro) with php (widthout using linux commands)? edit: sorry, the objective is to be aware of the ram available in the server / virtual machine, for the particular server (even if that…
yoda
  • 10,834
  • 19
  • 64
  • 92
39
votes
2 answers

High Java memory usage even for small programs

I have a couple of simple applications written in java, one of them written to act as a widget. What surprised me how much RAM even small applications use. I wrote the following to see if it is a bug in my programs, or a general Java issue: public…
Vivo
  • 391
  • 1
  • 3
  • 5
37
votes
5 answers

R reading a huge csv

I have a huge csv file. Its size is around 9 gb. I have 16 gb of ram. I followed the advises from the page and implemented them below. If you get the error that R cannot allocate a vector of length x, close out of R and add the following line to…
user2543622
  • 5,760
  • 25
  • 91
  • 159
35
votes
4 answers

How can I create a RAM disk programmatically?

I am not looking for a code that invokes a command line utility, which does the trick. I am actually interested to know the API used to create a RAM disk. EDIT Motivation: I have a third party library which expects a directory name in order to…
mark
  • 59,016
  • 79
  • 296
  • 580
32
votes
6 answers

How to get total RAM size of a device?

I want to get full RAM size of a device. memoryInfo.getTotalPss() returns 0. There is not function for get total RAM size in ActivityManager.MemoryInfo. How to do this?
BOOMik
  • 423
  • 1
  • 5
  • 13
32
votes
1 answer

How to see Linux' view of the RAM in order to determinate the fragmentation

The only program relevant I know of is pmap, but this only prints the memory of one process. I would like to see how the physical memory is occupied and by which processes/library, including the kernel, of the entire physical RAM (as opposed to that…
Flavius
  • 13,566
  • 13
  • 80
  • 126
32
votes
5 answers

How to get CPU usage and RAM usage without exec?

How does VBulletin get the system information without the use of exec? Is there any other information I can get about the server without exec? I am interested in: bandwidth used system type CPU speed/usage/count RAM usage
Rami Dabain
  • 4,709
  • 12
  • 62
  • 106
32
votes
4 answers

How do you determine the amount of Linux system RAM in C++?

I just wrote the following C++ function to programmatically determine how much RAM a system has installed. It works, but it seems to me that there should be a simpler way to do this. Am I missing something? getRAM() { FILE* stream = popen("head…
Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
32
votes
2 answers

Why is Pandas Concatenation (pandas.concat) so Memory Inefficient?

I have about 30 GB of data (in a list of about 900 dataframes) that I am attempting to concatenate together. The machine I am working with is a moderately powerful Linux Box with about 256 GB of ram. However, when I try to concatenate my files I…
sfortney
  • 2,075
  • 6
  • 23
  • 43
31
votes
9 answers

How to get current CPU and RAM usage in C++?

is it possible, in C++, to get the current RAM and CPU usage? Is there a platform-indepentent function call?
tunnuz
  • 23,338
  • 31
  • 90
  • 128
31
votes
3 answers

How does the internal implementation of memcpy work?

How does the standard C function 'memcpy' work? It has to copy a (large) chunk of RAM to another area in the RAM. Since I know you cannot move straight from RAM to RAM in assembly (with the mov instruction) so I am guessing it uses a CPU register as…
PersonWithName
  • 848
  • 2
  • 13
  • 19
29
votes
4 answers

How does random access memory work? Why is it constant-time random-access?

Or in other words, why does accessing an arbitrary element in an array take constant time (instead of O(n) or some other time)? I googled my heart out looking for an answer to this and did not find a very good one so I'm hoping one of you can share…
Kacy
  • 3,330
  • 4
  • 29
  • 57
27
votes
2 answers

Redis: Database Size to Memory Ratio?

What is Redis's database size to memory ratio? For instance, if I have an 80MB database, how much RAM will Redis use (when used with a normal web app)?
Philip Wernersbach
  • 461
  • 1
  • 5
  • 11
26
votes
2 answers

How are the gather instructions in AVX2 implemented?

Suppose I'm using AVX2's VGATHERDPS - this should load 8 single-precision floats using 8 DWORD indices. What happens when the data to be loaded exists in different cache-lines? Is the instruction implemented as a hardware loop which fetches…
Anuj Kalia
  • 803
  • 8
  • 16