This topic describes how to release a collection from memory after a search or a query to reduce memory usage.
from pymilvus import Collection
collection = Collection("book" )
collection.release()
await milvusClient.releaseCollection ({
collection_name : "book" ,
});
err := milvusClient.ReleaseCollection(
context.Background(),
"book" ,
)
if err != nil {
log.Fatal("failed to release collection:" , err.Error())
}
milvusClient.releaseCollection (
ReleaseCollectionParam .newBuilder ()
.withCollectionName ("book" )
.build ()
);
release -c book
curl -X 'DELETE' \
'http://localhost:9091/api/v1/collection/load' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"collection_name": "book"
}'
Parameter
Description
partition_name
(optional)
Name of the partition to release.
Parameter
Description
collection_name
Name of the collection to release.
Parameter
Description
ctx
Context to control API invocation process.
CollectionName
Name of the collection to release.
Parameter
Description
CollectionName
Name of the collection to release.
Option
Description
-c
Name of the collection to release.
-p (Optional/Multiple)
The name of the partition to release.
Parameter
Description
collection_name
Name of the collection to release.
Releasing the collection that is successfully loaded is allowed.
Releasing the collection is allowed when its partition(s) are loaded.
Error will be returned at the attempt to release partition(s) when the parent collection is already loaded. Future releases will support releasing partitions from a loaded collection, and loading the collection when its partition(s) are released.
Learn more basic operations of Milvus: