Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …
Tag: memory
How to get Resident Set Size (RSS)
I need to know physical memory consumption of my Go process in Linux. What I need is Resident Set Size (RSS). runtime.ReadMemStats is not suitable because there is no way to get a size of a portion of a virtual memory that is resident. syscall.Getrusage is not suitable because it returns only Maxrss that is m…
Will process load into memory with 4 or 8 alignment rule
I just learnt about 4 or 8 memory alignment and came about this question. Will Memory alignment happen in virtual memory space or absolute addresss? I guess the answer is virtual memory space, and the os will load the process to the position that the absolute address ends with ‘0X00’ or ‘0X0…
Virtual address to physical address and reverse in android linux kernel
I’m trying to transform virtual address to physical address and map this physical address to virtual address with android linux kernel environment. I can modify kernel code. So I tried next flow. malloc() in android user space native binary not app Transform va from malloc() to pa using the guide Is the…
How can i get memory usage by a process in freeRTOS
As we all know, we can get RAM currently used by a process in Linux using commands like ps, top and vmstat or reading the pseudo-filesystem /proc. But how can i get the same information in freeRTOS where we could not use commands and there exist no file system. Answer First there’s no process context in…
Computing the set of writes when executing a function
I want to write a function computeWriteSet that takes an arbitrary function f as an argument and (1) executes the function f and (2) returns the set of places modified or written to (addresses/pages/objects) during f’s execution. What options exist for implementing it? What are their tradeoffs (in which…
Dynamic expansion of the Linux stack
I’ve noticed the Linux stack starts small and expands with page faults caused by recursion/pushes/vlas up to size getrlimit(RLIMIT_STACK,…), give or take (defaults to 8MiB on my system). Curiously though, if I cause page faults by addressing bytes directly, within the limit, Linux will just regula…
How many maximum shared memory keys can be created using ftok() in linux?
I am creating share memory keys using ftok(). I want to create 500 share memory keys.As per man page of ftok() it is mentioned that low order 8 bits are significant. Does it mean that we can only generate 256 maximum share memory keys? If yes, Then how to generate more than 256 keys? Because in argument ftok(…
Finding mapped memory from inside a process
Setup: Ubuntu 18×64 x86_64 application Arbitrary code execution from inside the application I’m trying to write code which should be able to find structures in memory even with ASLR enabled. Sadly, I couldn’t find any static references to those regions, so I’m guessing I have to use the…
LMDB: Open large databases in a limited memory system
I have a program that is projected to use a few GB of lmdb diskspace (it’s a blockchain, and we’re moving away from leveldb due to its lack of ACID, which I need for some future plans). Is it possible to run that program with that database on a Raspberry Pi without adding more swap (with >1 GB …