- Sceneform SDK for Android was open sourced and archived (github.com/google-ar/sceneform-android-sdk) with version 1.16.0.
- This site (developers.google.com/sceneform) serves as the documentation archive for the previous version, Sceneform SDK for Android 1.15.0.
- Do not use version 1.17.0 of the Sceneform Maven artifacts.
- The 1.17.1 Maven artifacts can be used. Other than the version, however, the 1.17.1 artifacts are identical to the 1.15.0 artifacts.
ResourceHolder
Stay organized with collections
Save and categorize content based on your preferences.
Known Indirect Subclasses
|
Pool or cachce for resources
Public Methods
abstract
void
|
|
abstract
long
|
|
Public Methods
public
abstract
void
destroyAllResources
()
Ignores reference count and disposes any associated resources.
public
abstract
long
reclaimReleasedResources
()
Polls for garbage collected objects and disposes associated data.
Returns
- Count of resources in use.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-26 UTC.
[null,null,["Last updated 2024-06-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eResourceHolder\u003c/code\u003e is an interface that manages the lifecycle of resources, often used for pooling or caching.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to destroy all resources (\u003ccode\u003edestroyAllResources\u003c/code\u003e) and reclaim released resources (\u003ccode\u003ereclaimReleasedResources\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ereclaimReleasedResources\u003c/code\u003e disposes of garbage collected objects and returns the count of resources still in use.\u003c/p\u003e\n"]]],["`ResourceHolder` manages resources, offering methods to handle their lifecycle. `destroyAllResources` forces the disposal of all associated resources, disregarding any existing reference counts. `reclaimReleasedResources` checks for garbage-collected objects and releases their associated data, returning the count of resources currently in use. A related class, `CleanupRegistry`, maintains a queue and triggers a `Runnable` when objects are garbage-collected. These features manage resource lifecycle and garbage collection within the system.\n"],null,["# ResourceHolder\n\npublic interface **ResourceHolder** \n\n|---|---|---|\n| Known Indirect Subclasses [CleanupRegistry](/sceneform/reference/com/google/ar/sceneform/rendering/CleanupRegistry)\\\u003cT\\\u003e |------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [CleanupRegistry](/sceneform/reference/com/google/ar/sceneform/rendering/CleanupRegistry)\\\u003cT\\\u003e | Maintains a [ReferenceQueue](https://developer.android.com/reference/java/lang/ref/ReferenceQueue) and executes a [Runnable](https://developer.android.com/reference/java/lang/Runnable) after each object in the queue is garbage collected. | |||\n\nPool or cachce for resources \n\n### Public Methods\n\n|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract void | [destroyAllResources](/sceneform/reference/com/google/ar/sceneform/resources/ResourceHolder#destroyAllResources())() Ignores reference count and disposes any associated resources. |\n| abstract long | [reclaimReleasedResources](/sceneform/reference/com/google/ar/sceneform/resources/ResourceHolder#reclaimReleasedResources())() Polls for garbage collected objects and disposes associated data. |\n\nPublic Methods\n--------------\n\n#### public abstract void\n**destroyAllResources**\n()\n\nIgnores reference count and disposes any associated resources. \n\n#### public abstract long\n**reclaimReleasedResources**\n()\n\nPolls for garbage collected objects and disposes associated data. \n\n##### Returns\n\n- Count of resources in use."]]