IP Library Granted Patent US 9,355,029
Granted Patent B2
US 9,355,029 · App. 13/930,931 · Granted May 31, 2016

Thread-based memory management with garbage collection

Inventor: Martin Moser (Walldorf, DE)
Assignee: SAP SE
G06F12/0253G06F12/023
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 9,355,029
App. No.
13/930,931
Granted
May 31, 2016
Kind
B2
Abstract

Systems and methods for thread-based memory management may include activating a processing thread. The memory may include a first region and a second region with the first region having several segments. A segment of memory may be allocated for the processing thread. Data associated with an object may be stored in the segment. At the end of processing by the processing thread, a garbage collection process may be performed by the processing thread on the segment allocated to the processing thread.

Claims (70)

1. A computer-implemented method for managing the allocation of memory comprising:

activating a processing thread;

allocating memory for the processing thread, wherein the allocated memory includes a first region having a plurality of segments;

determining if data associated with an object utilized by the processing thread is to be stored in the first region of the allocated memory;

determining if the data associated with the object can be stored in a first segment of the plurality of segments;

storing the data associated with the object in the first segment in response to the determination that the data associated with the object can be stored in the first segment; and

the processing thread including code performing a garbage collection process on the allocated first segment prior to termination of the processing thread.

2. The method of claim 1 further comprising:

allocating a second segment of the plurality of segments in response to a determination that the data associated with the object cannot be stored in the first segment;

dividing the data associated with the object into a first portion of the data associated with the object and a second portion of the data associated with the object; and

storing the first portion of the data associated with the object in the first segment and storing the second portion of the data associated with the object in the second segment of the plurality of segments.

3. The method of claim 2 further comprising:

determining if a number of segments allocated to the processing thread exceed a predetermined value.

4. The method of claim 3 further comprising:

performing a garbage collection process on the first segment and the second segments if the number of segments allocated to the processing thread exceed the predetermined value.

5. The method of claim 3 further comprising:

terminating the processing thread if the number of segments allocated to the processing thread exceed the predetermined value.

6. The method of claim 1 further comprising:

determining if the data associated with the object can be stored in a second region of the allocated memory if the data associated with the object cannot be stored in the first region;

allocating the portion of the second region for storing the data associated with the object in response to the determination that the data associated with the object can be stored in the second region and in response to the determination that the data associated with the object cannot be stored in the first region; and

storing the data associated with the object at the allocated portion of the second region in response to the determination that the data associated with the object cannot be stored in the first region.

7. The method of claim 1 further comprising:

determining if the data associated with the object can be stored in a portion of a second region of the allocated memory in response to the determination that the data associated with the object cannot be stored in the first segment; and

the processing thread performing a garbage collection process on a portion of the second region if the data associated with the object cannot be stored in the second region.

8. The method of claim 7 further comprising:

determining if the data associated with the object can be stored in a portion of the second region after the garbage collection process;

allocating the portion of the second region for storing the data associated with the object in response to the determination that the data associated with the object can be stored in the portion; and

storing the data associated with the object at the allocated portion of the second region.

9. The method of claim 1 , wherein the garbage collection process is a mark and sweep process.

10. The method of claim 1 , wherein the garbage collection process is a copying collection process.

11. A system comprising:

a memory having a first region that includes a plurality of segments; and

a storage device storing instructions that, when executed by a processing module of the system, cause the processing module to perform operations comprising:

activating a processing thread;

allocating a first segment of the plurality of segments for the processing thread,

determining if data associated with an object is to be stored in the memory,

determining if the data associated with the object can be stored in the allocated first segment,

determining if the plurality of segments has an allocatable second segment in response to the determination that the data associated with the object cannot be stored in the allocated first segment,

if the data associated with the object cannot be stored in the allocated first segment and the first region has an allocatable second segment:

allocating the second segment of the plurality of segments for the processing thread, and

storing the data associated with the object at the allocated portion of the second segment, and

the processing thread including code performing a garbage collection process on the first segment and the second segment prior to termination of the processing thread.

12. The system of claim 11 , wherein the operations further comprise:

determining if a number of segments allocated to the processing thread exceed a predetermined value.

13. The system of claim 12 , wherein the operations further comprise:

performing a garbage collection process on the first segment and the second segment if the number of segments allocated to the processing thread exceed the predetermined value.

14. The system of claim 12 , wherein the operations further comprise:

terminating the processing thread if the number of segments allocated to the processing thread exceed the predetermined value.

15. The system of claim 11 , wherein the operations further comprise:

if the data associated with the object cannot be stored in the allocated first segment and the first region does not have an allocatable second segment:

determining if the data associated with the object can be stored in a second region of the memory,

allocating the portion of the second region for storing the data associated with the object, and

storing the data associated with the object at the allocated portion of the second region.

16. A non-transitory computer-readable storage device storing instructions that, when executed by a processing module, cause the processing module to perform operations comprising:

activating a processing thread;

allocating a memory for the processing thread, wherein the allocated memory includes a first region having a plurality of segments to store data for objects to be created during the processing performed by the processing thread;

storing data associated with an object in a first segment of the plurality of segments;

the processing thread including code performing a garbage collection process on the plurality of segments prior to termination of the processing thread; and

releasing the plurality of segments.

17. The non-transitory computer-readable storage device of claim 16 , storing instructions to perform operations further comprising:

determining if a number of segments of the plurality of segments allocated to the processing thread exceed a predetermined value; and

terminating the processing thread if the number of segments of the plurality of segments allocated to the processing thread exceed the predetermined value.

18. The non-transitory computer-readable storage device of claim 16 , storing instructions to perform operations further comprising:

determining if data associated with a second object can be stored in the plurality of segments,

if the data associated with a second object cannot be stored in the plurality of segments:

determining if the data associated with the second object can be stored in a portion of a second region of the allocated memory,

allocating the portion of the second region for storing the data associated with the second object, and

storing the data associated with the second object at the allocated portion of the second region.

19. The non-transitory computer-readable storage device of claim 16 , wherein the plurality of segments of the memory for the processing thread are automatically allocated by a runtime system.

20. The non-transitory computer-readable storage device of claim 19 , wherein the runtime system is a Java® runtime system.

Assignments (2)
CHANGE OF NAME Recorded Aug 26, 2014
From: SAP AG
To: SAP SE
Reel/Frame 033625/0223 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 28, 2013
From: MOSER, MARTIN
To: SAP AG
Reel/Frame 030712/0767 →
Continuity (1)
Related Publication 20150006843A1 · Jan 1, 2015