Does any one know what tool to use to visualize how is memory layed out for C on linux systems. I mean how much stack portion is used in functional call.
Where exactly does the argument to function sit in memory ?
I have written small program pasted below. But I am not able to infer anything with the output I am getting.
(attached is the c code)
Global variable 'add' is used to locate the stack's base.
I don't know if this technique works ? waiting for your views
What's the best way to find out how much memory is being used/available? I tried using free, but I didn't quite understand the output. Can someone explain it?
$ free
total used free shared buffers cached
Mem: 16304536 16256376 48160 0 ... (6 Replies)
Hi,
I having problem with my linux machine
it have 6Gb physical memory and somehow it always almost coming to the bottom neck and than it start writing to the swap memory
you can see that there is more than 4G in cahce, is there any way to clean the cache or to limit it to 2Gb?
host1... (6 Replies)
Hi
I have Fedora linux with XFCE desktop. I want to use Indic lanquage in that. I have installed unicode devnagri fonts. But I am not able to change my default keyboard layout. How can I change default keyboard layout in XFCE or through command line.
Thanks
NeeleshG (0 Replies)
Hi All,
We are using the linux servers and need to track the memory utilization of the box. Could anyone advice how the same can be achived.
:) (1 Reply)
I am trying to create an application that will be able to sniff memory of other applications.
I am not completely new to systems programming but I am not sure how to go about this task. I understand that accomplishing this mainly require these steps.
1: Get a list of processes
2: Find the... (2 Replies)
Hello, I am using Linux os.
$ df -k /dev/shm
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 2023256 1065000 958256 53% /dev/shm
$
Based on my google this, it is shared memory. What is this shared memory and where exactly it is used? Can you... (5 Replies)
In the following code, why the final result of "usC=cA+(char)ucB;" is 0xFF00?
In my opioion the memory layout of cA is "10000000" and
(char)cB is "10000000",usC type is unsigned short ,so the result should be "100000000" ,the 0x100.
Please help tell me what is wrong? Thanks!!;)
... (2 Replies)
Discussion started by: micky.zhou
2 Replies
LEARN ABOUT NETBSD
stack_align
STACK(9) BSD Kernel Developer's Manual STACK(9)NAME
STACK -- stack macros
SYNOPSIS
#include <sys/param.h>
type
STACK_ALLOC(sp, size);
type
STACK_MAX(sp, size);
type
STACK_ALIGN(sp, bytes);
type
STACK_GROW(sp, size);
type
STACK_SHRINK(sp, size);
DESCRIPTION
A stack is an area of memory with a fixed origin but with a variable size. A stack pointer points to the most recently referenced location
on the stack. Initially, when the stack has a size of zero, the stack pointer points to the origin of the stack. When data items are added
to the stack, the stack pointer moves away from the origin.
The STACK_ALLOC() macro returns a pointer to allocated stack space of some size. Given the returned pointer sp and size, STACK_MAX() returns
the maximum stack address of the allocated stack space. The STACK_ALIGN() macro can be used to align the stack pointer sp by the specified
amount of bytes.
Two basic operations are common to all stacks: a data item is added (``push'') to the location pointed by sp or a data item is removed
(``pop'') from the stack. The stack pointer must be subsequently adjusted by the size of the data item. The STACK_GROW() and STACK_SHRINK()
macros adjust the stack pointer sp by given size.
A stack may grow either up or down. The described macros take this into account by using the __MACHINE_STACK_GROWS_UP preprocessor define.
SEE ALSO param(3), queue(3)BSD April 8, 2011 BSD