Task #11490 (new)
Opened 11 years ago
Last modified 8 years ago
Thread-safe memory-block helper
Reported by: | jamoore | Owned by: | java@… |
---|---|---|---|
Priority: | major | Milestone: | Unscheduled |
Component: | General | Version: | 4.4.8 |
Keywords: | n.a. | Cc: | mlinkert |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | n.a. |
Description (last modified by jamoore)
A thread-safe helper should be written that will allow tests to check out large chunks of memory that it hopes to use. The total size of the memory should default to the available JVM memory but should be configurable. The size take on each checkout, as well as how long to wait (if at all) should also be configurable. In pseudo-code:
public final static long oneGB = 1024 * 1024 * 1024; Helper helper = new Helper(); // Optionally: helper = new Helper(4 * oneGB); try { Memory memory = helper.acquireBytes(oneGB); // Optionally: // helper.acquireBytes(oneGB, 1000, TimeUnits.MILLISECONDS); // Possibly long-running processing here, but try to acquire // and free the memory as close to its usage as possible. } finally { memory.free(); }
See:
Change History (4)
comment:1 Changed 11 years ago by jamoore
- Description modified (diff)
comment:2 Changed 11 years ago by mlinkert
- Cc mlinkert added
comment:2 Changed 11 years ago by mlinkert
comment:3 Changed 8 years ago by sbesson
- Milestone changed from Testing2 to Unscheduled