Sponsored Content
Full Discussion: how allocate virtual memory
Top Forums Programming how allocate virtual memory Post 302115022 by munnu on Friday 20th of April 2007 06:45:20 AM
Old 04-20-2007
how allocate virtual memory

Hi Folks
can any body suggest how to allocate virtual memory any function for that
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unix Help - allocate more memory to /tmp

Hi Guys I using Solaris 8 and I need to change the size of my /tmp file. Was wondering does anyone know how to do this. Thanks Carson (1 Reply)
Discussion started by: cmackin
1 Replies

2. UNIX for Advanced & Expert Users

unable to allocate enough memory

On SunOS 5.8 I get an error when starting a large Java process with over 2Gb memory. Error occurred during initialization of VM Could not reserve enough space for object heap When stopping several other Java processes we can start this process. This seems to indicate that we don't have... (11 Replies)
Discussion started by: rein
11 Replies

3. UNIX for Advanced & Expert Users

How to allocate memory

Hi, I have 2 systems with same hardware and software. One system is giving me error "Error occurred during initialization of VM Could not reserve enough space for object " when I tried to increase JBoss App's heap size to 2GB while the other system is running fine without any issue. Is there... (5 Replies)
Discussion started by: ravi3553
5 Replies

4. UNIX for Advanced & Expert Users

Oracle how many memory allocate really

hi... i want to find oracle allocate how many memory really.. i execute this code to list memory on unix system : ps -eo pmem,args | sort -k 1 -r -n outputs ; %mem command 12.9|ora_smon_RTX 12.9|ora_s000_RTX 12.9|ora_reco_RTX 12.9|ora_qmnc_RTX... (2 Replies)
Discussion started by: utoptas
2 Replies

5. SuSE

shmget failed - cannot allocate memory

Hi, In my proj, one process was running for 2 days. after 2 days its throwing an error message "shmget failed cannot allocate memory". the same problem happened every time.i.e. i can reproduce the same issue if my process is running for every 2 days for a same operation.Within this 2 days there... (1 Reply)
Discussion started by: ManoharanMani
1 Replies

6. Linux

shmget failed - cannot allocate memory

Hi, In my proj, one process was running for 2 days. after 2 days its throwing an error message "shmget failed cannot allocate memory". the same problem happened every time.i.e. i can reproduce the same issue if my process is running for every 2 days for a same operation.Within this 2 days there... (1 Reply)
Discussion started by: ManoharanMani
1 Replies

7. Linux

shmget failed - cannot allocate memory

Hi, In my proj, one process was running for 2 days. after 2 days its throwing an error message "shmget failed cannot allocate memory". the same problem happened every time.i.e. i can reproduce the same issue if my process is running for every 2 days for a same operation.Within this 2 days there... (1 Reply)
Discussion started by: ManoharanMani
1 Replies

8. Programming

How to allocate memory to a string in C?

hi I want to take string as a input from user and the string is very very length. From the lengthy string i have to substring take first 16 letters, then next 8 letters,................... Please guide me how to write program to take lengthy string from user and sub string it. Thanks (4 Replies)
Discussion started by: atharalikhan
4 Replies

9. Solaris

unable to allocate enough memory

On SunOS 10 get an error when starting a large Java process with over 2Gb memory. Error occurred during initialization of VM Could not reserve enough space for object heap i have 32G memory !! , swap = 31G Please any advice !!! (3 Replies)
Discussion started by: moata_u
3 Replies

10. Programming

calloc fails: 'Cannot allocate memory'

Hi , experts. I work on Linux station (RedHat 5.7), regular user, but have root password. %> uname -a Linux ran1log06 2.6.18-238.1.1.el5 #1 SMP Tue Jan 4 13:32:19 EST 2011 x86_64 x86_64 x86_64 GNU/Linux %> cat /etc/issue Red Hat Enterprise Linux Client release 5.7 (Tikanga) Kernel \r on... (5 Replies)
Discussion started by: baruchgu
5 Replies
MALLOC(9r)																MALLOC(9r)

NAME
MALLOC - General: Allocates a variable-size section of kernel virtual memory SYNOPSIS
#include <sys/malloc.h> MALLOC( addr, cast, u_long size, int type, int flags ); ARGUMENTS
Specifies the memory pointer that points to the allocated memory. You specify the addr argument's data type in the cast argument. Speci- fies the data type of the addr argument and the type of the memory pointer returned by MALLOC. Specifies the size in bytes of the memory to allocate. Typically, you pass the size as a constant to speed up the memory allocation. Specifies the purpose for which the memory is being allocated. The memory types are defined in the file <malloc.h>. Typically, kernel modules use the constant M_DEVBUF to indicate that kernel module memory is being allocated (or freed). Specifies one of the following flag constants defined in /usr/sys/include/sys/mal- loc.h: Allocates memory from the virtual memory subsystem if there is not enough memory in the preallocated pool. This constant signifies that MALLOC can block. Does not allocate memory from the virtual memory subsystem if there is not enough memory in the preallocated pool. This constant signifies that MALLOC cannot block. Allocates zero-filled memory. You pass this bit value by ORing it to M_WAITOK or M_NOWAIT. DESCRIPTION
The MALLOC routine (macro) allocates at least size bytes from the kernel memory and returns the address of the allocated memory. A kernel module can allocate the memory in interrupt and process contexts. The MALLOC routine (macro) maintains a pool of preallocated memory for quick allocation. If there is not enough memory in the pool, MALLOC allocates memory from the virtual memory subsystem by calling kmem_alloc, which can potentially block (sleep). A kernel thread that allo- cates and frees memory to and from the preallocated pool. The MALLOC routine (macro) is actually a wrapper that calls malloc. A kernel module should not directly call the MALLOC routine. The type argument allows the memory allocator to keep track of memory usage by a subsystem. If the allocation size is greater than 16K, you must pass M_WAITOK to the flags argument. You cannot allocate more than 16K bytes of memory in interrupt context. NOTES
A memory corruption can occur if a device driver continues to use the memory after freeing it. The operating system provides a built-in mechanism to debug such erroneous use of memory. You can enable this debugging feature at boot time by providing the following boot parame- ter: kmem_debug=1. When you enable this debugging feature, the FREE routine stores the following in the last word of freed memory: The pro- gram counter (pc) of the module that last freed the memory The checksum of the memory content The MALLOC routine checks the checksum of the memory content before reallocating this corrupted memory. If the checksum of the memory con- tent does not match the corrupted memory, MALLOC stores the debug information and then causes the kernel to panic. The MALLOC routine stores the address and size of the corrupted memory and the pc of the routine that last freed it in a kmem_corrupt_data structure. You should consider the following when using this debugging feature: This debugging feature does not detect cases where the corruption occurs after MALLOC reallocates the freed memory to some other module. There is a small chance that the pc of the routine that freed the memory (stored in the last word of freed memory) may itself become corrupted. CAUTIONS
A device driver must not call MALLOC in interrupt context with the flags argument set to M_WAITOK. If flags is set to M_WAITOK, MALLOC checks if the kernel thread is in interrupt context. If so, MALLOC returns a null pointer and displays a message on the console terminal. The M_WAITOK flag implies that it is valid to allocate memory from the virtual memory subsystem if there is not enough memory in the preal- located pool. To be able to allocate memory from the virtual memory subsystem (which can page fault), the device driver must be in process context. RETURN VALUES
Upon successful completion, MALLOC returns the address of the allocated memory. The return type associated with this address is the same as that specified for the addr argument. If the memory allocation request cannot be fulfilled, MALLOC returns a null pointer in the addr argument. SEE ALSO
Routines: FREE(9r) MALLOC(9r)
All times are GMT -4. The time now is 03:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy