Unix and Linux Discussions Tagged with memory |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
63,029 |
Shell Programming and Scripting |
|
|
|
3 |
5,182 |
UNIX for Beginners Questions & Answers |
|
|
|
12 |
11,255 |
Linux |
|
|
|
1 |
14,251 |
UNIX for Beginners Questions & Answers |
|
|
|
7 |
6,738 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
48,321 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
9,371 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
4,495 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
4,762 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
1,914 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
17,551 |
AIX |
|
|
|
4 |
20,533 |
Solaris |
|
|
|
1 |
5,454 |
AIX |
|
|
|
11 |
2,988 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
3,091 |
Solaris |
|
|
|
0 |
6,816 |
Red Hat |
|
|
|
24 |
20,341 |
AIX |
|
|
|
8 |
4,566 |
AIX |
|
|
|
1 |
2,472 |
Programming |
|
|
|
3 |
6,395 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
3,187 |
Red Hat |
|
|
|
2 |
5,051 |
Red Hat |
|
|
|
3 |
1,491 |
Shell Programming and Scripting |
|
|
|
5 |
2,872 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
2,593 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
7,406 |
UNIX for Advanced & Expert Users |
|
|
|
1 |
2,181 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,028 |
AIX |
|
|
|
2 |
2,183 |
Programming |
|
|
|
2 |
5,999 |
Solaris |
|
|
|
1 |
4,838 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,340 |
Solaris |
|
|
|
2 |
2,344 |
Shell Programming and Scripting |
|
|
|
7 |
4,206 |
Programming |
|
|
|
3 |
9,469 |
Solaris |
|
|
|
6 |
3,856 |
Linux |
|
|
|
1 |
4,460 |
Solaris |
|
|
|
3 |
6,259 |
AIX |
|
|
|
5 |
3,140 |
Programming |
|
|
|
4 |
22,253 |
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)