Rest API and DICOM Query/Retrieve: Discarding Queries

Hi!

Question: is it possible to control when DICOM queries performed through the Rest API are discarded? If not, how are they deleted?

According to the book at this link:

http://book.orthanc-server.com/users/rest.html#performing-query-retrieve-and-find-with-rest

We can perform DICOM Query / Retrieve through the Rest API. That’s lovely, because it allows us to be independent of whatever PACS ther is in any given hospital our customer installs the solution we’re working on. It just needs to understand DICOM.

BUT

Since we’ll be performing tons of them on a daily basis, they must be discarded at some point in time. You see, we used to watch Orthanc memory consumption sit at about 20MB/30MB. It grows as images are imported and shrinks right after that.

For the first time on semi-successfull test we left Orthanc performing this periodic importing of images through Query/Retrieve. I just got back at the office and one of our instances is consuming 1807M of resident memory. Truth be told, it may be many things including (but not limited to): they way we compile Orthanc and the way we compile the plugins. And I’ll certainly look into that as well But I digres.

I just wanted to make sure no query sits idle in memory for much longer than it should.

Thanks in advance!

Luiz

To answer my own question: the config option QueryRetrieveSize is what I was looking for. It’s documentation reads like so:

// Maximum number of query/retrieve DICOM requests that are
// maintained by Orthanc. The least recently used requests get
// deleted as new requests are issued.

I might set a lower value than the default 10. This will ensure a quicker recycle since once a new request is made, every other should be discarded.

For completion’s sake, this is where/how it’s used internally:

Screenshot from 2019-01-16 12-13-34.png

Luiz