Unix and Linux Discussions Tagged with memory |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
70,172 |
Shell Programming and Scripting |
|
|
|
3 |
7,004 |
UNIX for Beginners Questions & Answers |
|
|
|
12 |
14,340 |
Linux |
|
|
|
1 |
15,816 |
UNIX for Beginners Questions & Answers |
|
|
|
7 |
8,332 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
52,302 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
10,177 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
6,606 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
6,547 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
2,728 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
19,173 |
AIX |
|
|
|
4 |
25,481 |
Solaris |
|
|
|
1 |
6,592 |
AIX |
|
|
|
11 |
3,911 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
4,339 |
Solaris |
|
|
|
0 |
8,988 |
Red Hat |
|
|
|
24 |
23,097 |
AIX |
|
|
|
8 |
5,243 |
AIX |
|
|
|
1 |
3,099 |
Programming |
|
|
|
3 |
7,505 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
4,124 |
Red Hat |
|
|
|
2 |
6,787 |
Red Hat |
|
|
|
3 |
1,621 |
Shell Programming and Scripting |
|
|
|
5 |
3,438 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
3,173 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
7,936 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
2,407 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,322 |
AIX |
|
|
|
2 |
2,544 |
Programming |
|
|
|
2 |
6,429 |
Solaris |
|
|
|
1 |
5,185 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,567 |
Solaris |
|
|
|
2 |
2,575 |
Shell Programming and Scripting |
|
|
|
7 |
5,081 |
Programming |
|
|
|
3 |
9,800 |
Solaris |
|
|
|
6 |
4,336 |
Linux |
|
|
|
1 |
5,014 |
Solaris |
|
|
|
3 |
6,694 |
AIX |
|
|
|
5 |
3,404 |
Programming |
|
|
|
4 |
22,867 |
AIX |
FREE(9r) FREE(9r)
NAME
FREE - General: Deallocates (frees) the allocated kernel virtual memory
SYNOPSIS
#include <sys/malloc.h>
FREE(
void *addr,
int type );
ARGUMENTS
Specifies the memory pointer that points to the allocated memory to be freed. You must have previously set this pointer in the call to MAL-
LOC. You also define the data type for this argument in the call to MALLOC. 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).
DESCRIPTION
The FREE routine deallocates (frees) the allocated kernel virtual memory, which you allocated in a previous call to MALLOC.
NOTES
A memory corruption can occur if a kernel module 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.
RETURN VALUES
None
SEE ALSO
Routines: MALLOC(9r)
FREE(9r)