IP Library Granted Patent US 7,100,015
Granted Patent B1
US 7,100,015 · App. 10/663,604 · Granted Aug 29, 2006

Redirecting external memory allocation operations to an internal memory manager

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,100,015
App. No.
10/663,604
Granted
Aug 29, 2006
Kind
B1
Abstract

One embodiment of the present invention provides a system that facilitates redirecting external memory allocation operations, generated during calls by an application to external library functions, to an internal memory manager within the application. The system starts by encountering a call to an external library function during execution of the application. The system then determines if the external library function can call an internal memory allocation function, and if so, redirects the call to an internal memory allocation function within the application.

Claims (36)

1. A method for redirecting external memory allocation operations, generated during calls by an application to external library functions, to an internal memory manager within the application, comprising:

encountering a call to an external library function that performs a memory allocation operation during execution of the application;

determining if the external library function can call to an internal memory allocation function within the application that allocates memory from a pool that is managed by the application, wherein determining if the external library function can call an internal memory allocation function involves reading a pre-determined indicator value, which indicates whether the external library function can call the internal memory allocation function, and wherein the method further comprises pre-determining a value for the pre-determined indicator value by examining the external library function to determine whether the external library function or a function called by the external library function will call a memory allocation function, and whether there are external references to external memory blocks allocated by the external library function; and

if so,

redirecting the call to the internal memory allocation function, and

allocating the memory using the internal memory allocation function so that memory can be allocated from the pool that is managed by the application.

2. The method of claim 1 , wherein the application is a platform-independent virtual machine.

3. The method of claim 1 , wherein the application runs in single-threaded mode on a computing device.

4. The method of claim 1 , wherein the application runs on a memory-constrained computing device.

5. The method of claim 1 , wherein redirecting the call to the internal memory allocation function involves executing an interpose function that calls the internal memory allocation function.

6. The method of claim 1 , further comprising garbage collecting memory allocated by the internal memory allocation function.

7. The method of claim 1 , wherein the internal memory allocation function allocates memory in a heap.

8. A computer-readable storage medium storing instructions that when executed by a computer cause the computer to perform a method for redirecting external memory allocation operations, generated during calls by an application to external library functions, to an internal memory manager within the application, the method comprising:

encountering a call to an external library function that performs a memory allocation operation during execution of the application;

determining if the external library function can call to an internal memory allocation function within the application that allocates memory from a pool that is managed by the application, wherein determining if the external library function can call an internal memory allocation function involves reading a pre-determined indicator value, which indicates whether the external library function can call the internal memory allocation function, and wherein the method further comprises pre-determining a value for the pre-determined indicator value by examining the external library function to determine whether the external library function or a function called by the external library function will call a memory allocation function, and whether there are external references to external memory blocks allocated by the external library function; and

if so,

redirecting the call to the internal memory allocation function, and

allocating the memory using the internal memory allocation function so that memory can be allocated from the pool that is managed by the application.

9. The computer-readable storage medium of claim 8 , wherein the application is a platform-independent virtual machine.

10. The computer-readable storage medium of claim 8 , wherein the application runs in single-threaded mode on a computing device.

11. The computer-readable storage medium of claim 8 , wherein the application runs on a memory-constrained computing device.

12. The computer-readable storage medium of claim 8 , wherein redirecting the call to the internal memory allocation function involves executing an interpose function that calls the internal memory allocation functions.

13. The computer-readable storage medium of claim 8 , wherein the method further comprises garbage collecting memory allocated by the internal memory allocation function.

14. The computer-readable storage medium of claim 8 , wherein the internal memory allocation function allocates memory in a heap.

15. An apparatus for redirecting external memory allocation operations, generated during calls by an application to external library functions, to an internal memory manager within the application, comprising:

an execution mechanism configured to execute a call to an external library function that performs a memory allocation operation during execution of the application;

a determination mechanism configured to determine if the external library function can call to an internal memory allocation function within the application that allocates memory from a pool that is managed by the application, wherein determining if the external library function can call an internal memory allocation function involves reading a pre-determined indicator value, which indicates whether the external library function can call the internal memory allocation function;

a precomputation mechanism configured to precompute the pre-determined indicator value by examining the external library function to determine whether the external library function or a function called by the external library function will call a memory allocation function, and whether there are external references to external memory blocks allocated by the external library function;

a redirection mechanism configured to redirect the call to the internal memory allocation function; and

an internal memory allocation function configured to allocate memory so that memory can be allocated from the pool that is managed by the application.

16. The apparatus of claim 15 , wherein the application is a platform-independent virtual machine.

17. The apparatus of claim 15 , wherein the application runs in single-threaded mode on a computing device.

18. The apparatus of claim 15 , wherein the application runs on a memory-constrained computing device.

19. The apparatus of claim 15 , wherein the redirection mechanism is further configured to execute an interpose function that calls the internal memory allocation functions.

20. The apparatus of claim 15 , further comprising a garbage collection mechanism configured to garbage collect memory allocated by the internal memory allocation function.

21. The apparatus of claim 15 , wherein the internal memory allocation function allocates memory in a heap.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037302/0616 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 15, 2003
From: MATHISKE, BERND J.W.; LEE, TECK YANG
To: SUN MICROSYSTEMS, INC.
Reel/Frame 014519/0287 →