Memory leak on mobile server

Our project uses integration with Milestone software using MIP SDK Mobile, TMC software (Traffic management system) pulls streams from cameras (72 pieces) and metrics / statuses. The metrics are updated every 1 minute, connection to camera streams is on demand.

RAM leaks periodically, and when connecting to the Xproteсt, an error occurs an incorrect username or password (after restarting the mobile server service) works without problems for some time.

All errors recorded:

1. When viewing video from cameras via SDK on the application page, we get:

<?xml version="1.0" encoding="utf-8"?>

<Communication xmlns:xsd=“http://www.w3.org/2001/XMLSchema

xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>

0b706520-ccab-48b1-b59f-cc88410e13db

   <Type>Response</Type>

   <Name>LogIn</Name>

   <InputParams />

   <OutputParams />

   <Items />

   <Result>Error</Result>

   <ErrorCode>15</ErrorCode>

2. When accessing the API of the mobile milestone server, we get:

“{“error”:“Error: Login to milestone failed”}”

or

Socket Timeout

3. The MobileOS server service does not free up memory. Drops 45 GB of occupied RAM. It also falls without memory leaks. Sometimes right after the start.

4. The problem of getting screenshots:

<?xml version="1.0" encoding="utf-8"?>

c839e543-4e54-4a61-ae36-bc78c13f4b0c

Response

GetThumbnailByTime

Error

43

Hi,

As I understand you see 3 different issues - login, memory leak , GetThumbnail

Please correct me if I am wrong

  1. Login issues - this refer to point 1 and 2 -Could you please give us some additional info - what version of the software you use (both XPCO and Mobile Server). Is this a regression after an upgrade or it has always behaved like that. How long does a login take when successful. Which Mobile SDK version you use (Web, Android, iOS, .Net).
  2. Memory leak - could you please brief what commands are called to the Server when you see the Memory leak. can you provide us with a wireshark trace?. What do you mean by - “It also falls without memory leaks”. Is it a crash after a restart?
  3. The error code means one of the input parameters is too long can you provide us with the request you make?

Hi MIkhail,

Those could be different unrelated (between each other) issues.

I’ll add just few more things.

As Svetlana already wrote, First of all we would like to know what version the Mobile server you are using, as well as the version of the whole VMS and version and type of the MIP SDK Mobile (platform at least).

Now to the particular problems described.

1.There could be at least two different sources of this:

  • Unproperly initialized DH Key Exchange algorithm. We have seen this in particular version of the MIP SDK Mobile for Web (JS) for example. Therefore we need to know versions used. The reproduce rate is different and depends on the client but could vary from 1:10 to 1:1000 login attempts.
  • If you are using A/D users it could be possible some domain update tasks to have effect on log-in attempt. We have customer where when running script only with login commands we see 1 failure on every 5 minutes. It turns out that in this time is executed some account sync in domain (or similar)

2,3. Again as Svetlana already wrote, we would need more information of how you reproduce the issue with this increased RAM consumption. Can you somehow isolate it? For example is it happen after opening or closing of many different video streams? Or it happens after many request of GetThumbnailByTime command?

Sorry for the stupid question but is it possible video connections to not be closed (properly) by the consumer (e.g constantly increasing the number of the active connections)? You can easily check this via Tray Manager (Show Status) or Management Client (Mobile server settings - Server Status tab).

4.As Svetlana said error code 43 means there was parameter in the command that was too long and was sanitized. So yes, we will need the sample input command. Btw does it change the behavior if you decrease the size of the requested thumbnail ? Is the responded value of the “Thumbnail” actually a valid JPEG (base64 encoded of course) ? I wonder if it is a too big and was sanitized for example.

Hi all,

  1. Svetlana, we used:
  • Xprotect Corporate R2 20.2a
  • Mobile Server 20.2a (2552)
  • SDK Mobile Web
  • Installed all hotfixes.

Petar, we will check initialized DH Key Exchange algorithm and we don’t use AD.

2,3) Svetlana, at the time of the memory leak - authorization commands are executed.

Petar, it happens after many request of command and many request of autorization. What is the maximum number of sessions I can make under one user, are there any restrictions, maybe this is the problem?

“Sorry for the stupid question but is it possible video connections to not be closed (properly) by the consumer (e.g constantly increasing the number of the active connections)?” - 72 connection..

  1. I will pass this information on to our programmers.

Thanks for the quick reply, I will return to you with detailed information later!

Hi Mikhail,

Thanks for your answer!

I’m not sure however I fully understand your comment about 2 and 3.

In particular this one “it happens after many request of command and many request of authorization”.

What do you mean by command ? Is this the same GetThumbnailByTime command ? And by request of authorization do you mean the LogIn command ?

Can you further narrow dawn which one in particular causes it ?

For example only to many LogIn’s is enough. Or single LogIn and too many calls of GetThumbnailByTime.

In theory we do not have limit in number of active sessions.

You mentioned you are using 72 connections. Which is not so much high number. Does this mean you have 72 log-ins and for every one of them there are multiple request for GetThumbnailByTime ? Or you make LogIn, fetch one GetThumbnail and disconnect.

I want to understand a little bit more about your general workflow. Yesterday I ran automated tests with 2 000 logins and 20 000 calls of GetThumbnailByTime and I didn’t experience significant increase of used memory.

So there is probably something more specific in your particular workflow or system that I’m missing.

Also how many cameras are there in the whole VMS systems ? Are there only 72 ? Or there are few thousand for example. If you have very complex VMS configuration, from which you are using only 72 cameras, on every log-in, the mobile server will cash the configuration for this particular user. And if the configuration is huge, the amount of used memory could be significant. We have never seen it above 10 gigs for example, but it could depend on the size of the configuration of course.

btw. Another thing that could have impact. Are you using HW acceleration on the Mobile server machine ? In particular do you have Nvidia GPU board (model, drivers) and/or Intel CPU with integrated graphics ?

And the last one - JS SDK is used in the browser right ? Or you modified it to run in Node.js for example ?