QuantumEntangledAndy / neolink

An RTSP bridge to Reolink IP cameras
GNU Affero General Public License v3.0
297 stars 44 forks source link

neolink 4.0 - Heavy memory leak #58

Closed anthonws closed 1 year ago

anthonws commented 1 year ago

Setup: Docker container Version: thirtythreeforty/neolink:latest@sha256:aa7a19c16b17f6c878e450ce64032422ff35ccb01e12057b332a8957b5b536c8

Camera: Reolink E1 Pro Firmware version: 3.0.0.716_21112404

Config:

bind = "0.0.0.0"

[[cameras]]
name = "tapas_hall"
username = "admin"
password = "PASS"
address = "192.168.1.216:9000"
stream = "both"

Logs:

[2023-04-12T17:40:10Z INFO  neolink::rtsp] tapas_hall: Camera time is already set: 2023-04-12 19:40:11 +1
[2023-04-12T17:40:11Z INFO  neolink::rtsp] tapas_hall: Camera reports firmware version v3.0.0.716_21112404
[2023-04-12T17:40:11Z INFO  neolink::rtsp] tapas_hall: Starting video stream Main Stream (Clear)
(neolink:7): GLib-GObject-CRITICAL **: 17:40:31.615: g_object_new_is_valid_property: property 'name' for type 'GstRtpL16Pay' cannot be set twice
Segmentation fault (core dumped)
[2023-04-12T17:41:51Z INFO  neolink] Neolink 0.4.0 (unknown commit) release
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Connecting to camera at Address: 192.168.1.216:9000
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Logging in
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Connecting to camera at Address: 192.168.1.216:9000
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Logging in
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Connected and logged in
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Connected and logged in
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Starting video stream Sub Stream (Fluent)
[2023-04-12T17:41:51Z INFO  neolink::rtsp] tapas_hall: Camera time is already set: 2023-04-12 19:41:52 +1
[2023-04-12T17:41:52Z INFO  neolink::rtsp] tapas_hall: Camera reports firmware version v3.0.0.716_21112404
[2023-04-12T17:41:52Z INFO  neolink::rtsp] tapas_hall: Starting video stream Main Stream (Clear)
(neolink:7): GLib-GObject-CRITICAL **: 17:42:11.628: g_object_new_is_valid_property: property 'name' for type 'GstRtpL16Pay' cannot be set twice
(neolink:7): GLib-GObject-CRITICAL **: 19:56:23.796: g_object_new_is_valid_property: property 'name' for type 'GstRtpL16Pay' cannot be set twice
(neolink:7): GLib-GObject-CRITICAL **: 19:57:15.501: g_object_new_is_valid_property: property 'name' for type 'GstRtpL16Pay' cannot be set twice
image

Container reached 1.5GB in more or less 4hours of execution.

I will try with RUST_LOG trace to see if there are interesting logs to be shared.

Thanks, anthonws.

anthonws commented 1 year ago

After restarting the container, in less than 30 minutes it went from 39MB to 70MB (almost more 80%).

Most probably this is irrelevant now that you have rebuilt the architecture and you're hosting your own gstreamer, but might be valuable nevertheless.

image

Logs:

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(Norm)

[2023-04-12T21:39:53Z INFO  neolink::rtsp] tapas_hall: Camera time is already set: 2023-04-12 23:39:54 +1

[2023-04-12T21:39:53Z DEBUG neolink_core::bc::xml] Struct: start to parse "body"

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(body, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG neolink_core::bc::xml] Struct: start to parse "VersionInfo"

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(VersionInfo, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"}, [version -> 1.1])

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(name, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched Characters(Hall)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(name)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(type, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched Characters(E1 Pro)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(type)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(serialNumber, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(serialNumber)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(buildDay, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched Characters(build 21112404)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(buildDay)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(hardwareVersion, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched Characters(IPC_513SD5)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(hardwareVersion)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(cfgVersion, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched Characters(v3.0.0.0)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(cfgVersion)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(firmwareVersion, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched Characters(v3.0.0.716_21112404)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(firmwareVersion)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(detail, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched Characters(IPC_51316MS19E1W31100000001)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(detail)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(IEClient, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched Characters(IEClient)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(IEClient)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(pakSuffix, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched Characters(pak)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(pakSuffix)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(helpVersion, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched Characters(blackPointsLevel=0)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(helpVersion)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(VersionInfo)

[2023-04-12T21:39:53Z INFO  neolink::rtsp] tapas_hall: Camera reports firmware version v3.0.0.716_21112404

[2023-04-12T21:39:53Z INFO  neolink::rtsp] tapas_hall: Starting video stream Main Stream (Clear)

[2023-04-12T21:39:53Z DEBUG neolink_core::bc::xml] Struct: start to parse "Extension"

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(Extension, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"}, [version -> 1.1])

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched StartElement(binaryData, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched Characters(1)

[2023-04-12T21:39:53Z DEBUG yaserde::de] Fetched EndElement(binaryData)

[2023-04-12T21:39:54Z DEBUG neolink_core::bc::xml] Struct: start to parse "body"

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(body, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(VideoInput, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"}, [version -> 1.1])

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(channelId, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(0)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(channelId)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(bright, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(128)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(bright)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(contrast, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(128)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(contrast)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(saturation, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(128)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(saturation)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(hue, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(128)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(hue)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(VideoInput)

[2023-04-12T21:39:54Z DEBUG neolink_core::bc_protocol::connection::bcconn] Ignoring uninteresting message ID 78

[2023-04-12T21:39:54Z TRACE neolink_core::bc_protocol::connection::bcconn] Contents: Bc { meta: BcMeta { msg_id: 78, channel_id: 0, stream_type: 0, response_code: 200, msg_num: 0, class: 0 }, body: ModernMsg(ModernMsg { extension: None, payload: Some(BcXml(BcXml { encryption: None, login_user: None, login_net: None, device_info: None, version_info: None, preview: None, system_general: None, norm: None, led_state: None, talk_config: None, rf_alarm_cfg: None, talk_ability: None, alarm_event_list: None })) }) }

[2023-04-12T21:39:54Z DEBUG neolink_core::bc::xml] Struct: start to parse "body"

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(body, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(Serial, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"}, [version -> 1.1])

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(channelId, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(0)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(channelId)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(baudRate, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(9600)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(baudRate)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(dataBit, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(CS8)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(dataBit)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(stopBit, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(1)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(stopBit)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(parity, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(none)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(parity)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(flowControl, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(none)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(flowControl)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(controlProtocol, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(PELCO_D)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(controlProtocol)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched StartElement(controlAddress, {"": "", "xml": "http://www.w3.org/XML/1998/namespace", "xmlns": "http://www.w3.org/2000/xmlns/"})

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched Characters(1)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(controlAddress)

[2023-04-12T21:39:54Z DEBUG yaserde::de] Fetched EndElement(Serial)

[2023-04-12T21:39:54Z DEBUG neolink_core::bc_protocol::connection::bcconn] Ignoring uninteresting message ID 79

[2023-04-12T21:39:54Z TRACE neolink_core::bc_protocol::connection::bcconn] Contents: Bc { meta: BcMeta { msg_id: 79, channel_id: 0, stream_type: 0, response_code: 200, msg_num: 0, class: 0 }, body: ModernMsg(ModernMsg { extension: None, payload: Some(BcXml(BcXml { encryption: None, login_user: None, login_net: None, device_info: None, version_info: None, preview: None, system_general: None, norm: None, led_state: None, talk_config: None, rf_alarm_cfg: None, talk_ability: None, alarm_event_list: None })) }) }

(neolink:7): GLib-GObject-CRITICAL **: 21:39:55.294: g_object_new_is_valid_property: property 'name' for type 'GstRtpL16Pay' cannot be set twice

[2023-04-12T21:39:55Z DEBUG neolink::rtsp::gst] RTSP: media was configured
anthonws commented 1 year ago

I just noticed I was not using your docker images... Please ignore. :/ Still, it might be useful information. I have upgraded to 0.5.7 (both containers given I have them separate right now. one for a battery camera and another for a USB powered).