| CPC G06F 9/5016 (2013.01) [G06F 9/5022 (2013.01); G06F 9/45558 (2013.01); G06F 2009/45583 (2013.01); G06F 12/0253 (2013.01)] | 17 Claims |

|
13. A method comprising:
allocating, in a runtime environment, a segment of foreign memory to a first memory session, the runtime environment being configured to use a garbage collector to manage memory in a heap, and the foreign memory comprising off-heap memory that is not managed by the garbage collector;
opening, in the runtime environment, a second memory session that descends from the first memory session, wherein opening the second memory session that descends from the first memory session comprises:
receiving, by a function that instantiates the second memory session, a function call with a parameter comprising a first reference to the first memory session;
responsive to the function call:
instantiating the second memory session; and
storing a parent-child association between the first memory session and the second memory session; and
returning, as an output of the function that instantiates the second memory session, a second reference to the second memory session;
while the second memory session is open, encountering a first request to close the first memory session;
responsive to encountering the first request to close the first memory session, determining that the first memory session has at least one open descendant memory session; and
responsive to determining that the first memory session has at least one open descendant memory session, declining the first request to close the first memory session,
wherein the method is performed by at least one device comprising one or more hardware processors.
|