Sponsored Content
Top Forums Programming PC RAM and process address space Post 302577939 by rupeshkp728 on Wednesday 30th of November 2011 10:00:57 AM
Old 11-30-2011
PC RAM and process address space

Suppose I have 3 gb of ram and 250 gb hard disk in my pc.
Now I wrote a simple C program having only one statement malloc() to allocate 4 gb of memory as 32 bit os can address 4gb address space then will the malloc succeed?
If yes then how it will get extra 1 gb of memory?
Does the process gets memory only from RAM or also from harddisk?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to find the size of Process Address space.

Hello, Please help me to know, How to find out the how much amount of process addres space is required/is used for/by a process. Tnx & Regards Vishwa. (1 Reply)
Discussion started by: S.Vishwanath
1 Replies

2. UNIX for Dummies Questions & Answers

Ram space

Hi, I am new to Unix and I need to know how to find out how much Ram I have on my server. I have Sun Solaris operating system with Sun Ulta 10 cpu. Could you please let me know the command to find the current Ram I have? Thank you. (1 Reply)
Discussion started by: hollowayt
1 Replies

3. Solaris

RAM Physical Memory usage by each Process.

Hi All, I am trying to find the physical memory usage by each process/users. Can you please let me know how to get the memory usage?. Thanks, bsraj. (12 Replies)
Discussion started by: bsrajirs
12 Replies

4. UNIX for Dummies Questions & Answers

How to find out how much RAM that process is using

H:confused:ow to find out how much RAM that process is using. like how much memory java.exe process is consuming (3 Replies)
Discussion started by: redlotus72
3 Replies

5. Programming

Find Virtual address space size for process

Hi, I am looking to work on unix systems which include (hp-ux, ibm aix, solaris and linux). I want to get the total virtual address space of a process, the used virtual memory i am able to get without any problem. I have tried using getrlimit and getrlimit64, but that gives only ... (4 Replies)
Discussion started by: uiqbal
4 Replies

6. UNIX for Advanced & Expert Users

Can kernel process access user address space ?

Can kernel process access user address space ? (2 Replies)
Discussion started by: subhotech
2 Replies

7. Filesystems, Disks and Memory

Disk space and RAM status in UNIX

I have an application which is running under AIX, HP UNIX, SCO, and LINUX(redhat and SuSE). and its dealing with some bulk amount of file handling, and some of my boxes are not very good in terms of resources like memory and disk space. so i wanted to know the statistics of each of my boxes. Like... (2 Replies)
Discussion started by: renjithram
2 Replies

8. Solaris

How much portion of RAM is allocated to Swap space?

How swap is getting 12GB as its size as per the below output: Filesystem size used avail capacity Mounted on /dev/md/dsk/d0 7.9G 2.1G 5.7G 27% / /devices 0K 0K 0K 0% /devices ctfs 0K 0K 0K 0% /system/contract proc 0K 0K 0K 0% /proc mnttab 0K 0K 0K 0% /etc/mnttab swap 12G 1.2M 12G 1%... (3 Replies)
Discussion started by: ramnagaraj
3 Replies

9. Programming

How to get address space size that a process is allowed to use

Hi All, From C++, I just want to find the address space size that a process is allowed to use. For ex, in 32 bit OS the allowed address space is 4GB and in 64 bit OS I guess this is 16GB or more. I jsut want to find it in my C++ project. Is there any API calls that gives me such information.... (2 Replies)
Discussion started by: Sendil Kumar
2 Replies

10. Solaris

RAM Utilization per process

Hello All, My Server RAM utilization is exceeding 90% and i would like to idnetify the per process RAM utilization.. We are using Solaris 10 10/9 OS release... Is there any way achieve this ??? Definitely not interested in any of the third party tool but some Solaris command... ... (5 Replies)
Discussion started by: EmbedUX
5 Replies
bsdmalloc(3MALLOC)														bsdmalloc(3MALLOC)

NAME
bsdmalloc - memory allocator SYNOPSIS
cc [ flag ... ] file ... -lbsdmalloc [ library ... ] char *malloc(size); unsigned size; int free( ptr); char *ptr; char *realloc( ptr, size); char *ptr; unsigned size; These routines provide a general-purpose memory allocation package. They maintain a table of free blocks for efficient allocation and coa- lescing of free storage. When there is no suitable space already free, the allocation routines call sbrk(2) to get more memory from the system. Each of the allocation routines returns a pointer to space suitably aligned for storage of any type of object. Each returns a null pointer if the request cannot be completed. The malloc() function returns a pointer to a block of at least size bytes, which is appropriately aligned. The free() function releases a previously allocated block. Its argument is a pointer to a block previously allocated by malloc() or real- loc(). The free() function does not set errno. The realloc() function changes the size of the block pointed to by ptr to size bytes and returns a pointer to the (possibly moved) block. The contents will be unchanged up to the lesser of the new and old sizes. If the new size of the block requires movement of the block, the space for the previous instantiation of the block is freed. If the new size is larger, the contents of the newly allocated portion of the block are unspecified. If ptr is NULL, realloc() behaves like malloc() for the specified size. If size is 0 and ptr is not a null pointer, the space pointed to is freed. The malloc() and realloc() functions return a null pointer if there is not enough available memory. They return a non-null pointer if size is 0. These pointers should not be dereferenced. When realloc() returns NULL, the block pointed to by ptr is left intact. Always cast the value returned by malloc() and realloc(). If malloc() or realloc() returns unsuccessfully, errno will be set to indicate the following: ENOMEM size bytes of memory cannot be allocated because it exceeds the physical limits of the system. EAGAIN There is not enough memory available at this point in time to allocate size bytes of memory; but the application could try again later. Using realloc() with a block freed before the most recent call to malloc() or realloc() results in an error. Comparative features of the various allocation libraries can be found in the umem_alloc(3MALLOC) manual page. brk(2), malloc(3C), malloc(3MALLOC), mapmalloc(3MALLOC), umem_alloc(3MALLOC) WARNINGS
Use of libbsdmalloc renders an application non-SCD compliant. The libbsdmalloc routines are incompatible with the memory allocation routines in the standard C-library (libc): malloc(3C), alloca(3C), calloc(3C), free(3C), memalign(3C), realloc(3C), and valloc(3C). 21 Mar 2005 bsdmalloc(3MALLOC)
All times are GMT -4. The time now is 06:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy