Memory Leak?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Memory Leak?

killerrats
This post was updated on .
I was recording with this pipeline for more than 3 days. At the end of the
third day the memory was crazy big. it was above 200 mb in memory. Pipeline:

gst-launch-1.0 -e rtspsrc location=[IP] name=source ! rtph264depay !
h264parse ! mux.video splitmuxsink max-size-bytes=10485760 max-files=10240
muxer=avimux location=video%06d.avi name=mux source. ! rtpmp4gdepay !
aacparse ! mux.audio_0

I put together an application that uses the same pipeline the difference is that I checked the flow of the
 elements through the splitmuxsink to filesink and flows fine. It also is setting the next filename using the
format-location. For some reason still has the same problem. that one went up to 300mb of memory.

One thread here was saying to use async-handling=true. I haven't tried that
yet because well it will be several days before I get to see if it works or
not. Anyone know?



-----
------------------------------
Gstreamer 1.12.4
------------------------------
Windows
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.14.1
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: Memory Leak?

rland
killerrats wrote
> I was recording with this pipeline for more than 3 days. At the end of the
> third day the memory was crazy big. it was above 200 mb in memory.
> Pipeline:
>
> gst-launch-1.0 -e rtspsrc location=[IP] name=source ! rtph264depay !
> h264parse ! mux.video splitmuxsink max-size-bytes=10485760 max-files=10240
> muxer=avimux location=video%06d.avi name=mux source. ! rtpmp4gdepay !
> aacparse ! mux.audio_0

You can run valgrind to check where
there may be memory leak´╝înote that
pay attention to the "definitely lost" parts in summary. :)
Like this:
valgrind -v --tool=memcheck  --track-fds=yes  --leak-check=full
--show-reachable=yes --time-stamp=yes --undef-value-errors=no
--malloc-fill=0xc --free-fill=0xd --freelist-vol=100000000
--trace-children=yes --num-callers=50
--suppressions=gstreamer-1.0-1.14.0/common/gst.supp  --log-file=valgrind_gst
gst-launch-1.0 -e rtspsrc location=[IP] name=source ! rtph264depay !
h264parse ! mux.video splitmuxsink max-size-bytes=10485760 max-files=10240
muxer=avimux location=video%06d.avi name=mux source. ! rtpmp4gdepay !
aacparse ! mux.audio_0





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Memory Leak?

killerrats
I have windows that i'm using it on. but I did find a alternative which is
"very sleepy cs" and 14 day trial "Deleaker". They seem to work pretty well.



-----
------------------------------
Gstreamer 1.12.4
------------------------------
Windows
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.14.1
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: Memory Leak?

killerrats
I found another program.  Process Explore
<https://download.cnet.com/Process-Explorer/3000-2094_4-10223605.html>  
that will tell me quite a bit of information. I found interesting that in
the beginning it showed 259 handles where active and then it increased as it
went along. It came back down to 259 not too long after. I have already left
for two days now and the handles have increased and never came back down to
259. Its now at 273 and my memory is from 15 and increased to 18 megabytes.
By tomorrow it probably will increase in memory because like always on the
third day.

<http://gstreamer-devel.966125.n4.nabble.com/file/t377034/RecordingProgress06-12-2018-01-57-PM.jpg>



-----
------------------------------
Gstreamer 1.12.4
------------------------------
Windows
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.14.1
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: Memory Leak?

killerrats
This post was updated on .
Well increased 2 days later. this is a program I did my own console
application. I found out that the code I was using was 2016 source code on a
1.12.4 gstreamer.

The only thing I did was edit the splitmuxsink element. Got rid of the
second signal for format-location-full then did a couple of signals in the
filesink. Nothing that will effect the program that much.

gstsplitmuxsink.c

<http://gstreamer-devel.966125.n4.nabble.com/file/t377034/RecordingProgress06-14-2018-09-30-AM.jpg



-----
------------------------------
Gstreamer 1.12.4
------------------------------
Windows
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.14.1
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: Memory Leak?

killerrats
I upgraded to 1.14.1 and used the command line gst-launch that I used in the
first post. It did the same thing as before. it got up to 2k files out of
10k files. doesn't seem to quit out or anything. The handles didn't increase
this time.

gst-launch-1.0 -e rtspsrc location=[IP] name=source ! rtph264depay !
h264parse ! mux.video splitmuxsink async-handling=true
max-size-bytes=10485760 max-files=10240 muxer=avimux location=video%06d.avi
name=mux source. ! rtpmp4gdepay ! aacparse ! mux.audio_0

I used software verify memory validator and here is of a report from memory.
it took 4 1/2 days or so to get to this point. I can't seem to figure out
why?

gst_launch_10_mem_06_18_18
<http://www.planetkorey.com/tmp/gst_launch_10_mem.html>  



-----
------------------------------
Gstreamer 1.12.4
------------------------------
Windows
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.14.1
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: Memory Leak?

killerrats
This post was updated on .
So I did another test using the following pipeline. I added the tee for video
and audio side and queue after the tee to connect to the splitmuxsink.

gst-launch-1.0 --gst-debug=3 -e rtspsrc location=[IP] name=source !
rtpjitterbuffer ! rtph264depay ! h264parse ! tee name=vtee ! queue
max-size-buffers=50 ! mux.video splitmuxsink async-handling=true
max-size-bytes=10485760 max-files=360 muxer=avimux
location=D:/VideoStorageSplit2/video%06d.avi name=mux source. !
rtpjitterbuffer ! rtpmp4gdepay ! aacparse ! tee name=atee ! queue
max-size-buffers=50 ! mux.audio_0

*my application:*
specified buffers in queues' has internal flow error
not specifying the buffers just keeps going.
this is using the same way as above not a edited version of splitmuxsink and filesink I did earlier.
<http://gstreamer-devel.966125.n4.nabble.com/file/t377034/GstreamerRecordPipeline.png

*command line:*
specifying the buffers in queues' has timeout but maybe the same for
internal flow error
not having the buffers keeps going.

*Overall:*
haven't tried on command line adding the tee with queues' and not specifying
the buffers.



-----
------------------------------
Gstreamer 1.12.4
------------------------------
Windows
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.14.1
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: Memory Leak?

killerrats
rtspsrc location=[IP] name=source ! rtpjitterbuffer ! rtph264depay !
h264parse ! queue ! mux.video splitmuxsink async-handling=true
max-size-bytes=10485760 max-files=360 muxer=avimux
location=D:/VideoStorageSplit2/video%06d.avi name=mux source. !
rtpjitterbuffer ! rtpmp4gdepay ! aacparse ! queue ! mux.audio_0

So I put in my application joining together the elements the above pipeline
is what I followed. The program ran for more than a day but it increased the
memory to 1gb. It said the flow of the pads through the pipeline were okay.
I make the program check them every hour. It tracked it until the program
crashed and had the following error. The one thing I do is I use the signal
from the splitmuxsink "format-location" but I only return the filename to
use.

(VideoConvert.exe:5440): GLib-ERROR **: gmem.c:165: failed to allocate
7974144 bytes

the following errors occurred before it.

2018-5-23 9:11:15: Checking bus
19:18:25.073758257  5440   031339D8 WARN       codecparsers_h264
gsth264parser.c
:2182:gst_h264_parser_parse_slice_hdr: value greater than max. value: 4, max
2
19:18:25.075449813  5440   031339D8 WARN       codecparsers_h264
gsth264parser.c
:2219:gst_h264_parser_parse_slice_hdr: error parsing "Slice header"
19:18:25.210749970  5440   031339D8 WARN       codecparsers_h264
gsth264parser.c
:655:slice_parse_ref_pic_list_modification_1: value greater than max. value:
166
, max 63
19:18:25.212307989  5440   031339D8 WARN       codecparsers_h264
gsth264parser.c
:674:slice_parse_ref_pic_list_modification_1: error parsing "Reference
picture l
ist 0 modification"
19:18:25.213589437  5440   031339D8 WARN       codecparsers_h264
gsth264parser.c
:2219:gst_h264_parser_parse_slice_hdr: error parsing "Slice header"
19:18:25.340195472  5440   031339D8 WARN       codecparsers_h264
gsth264parser.c:2182:gst_h264_parser_parse_slice_hdr: value greater than
max. value: 6, max 219:18:25.342064425  5440   031339D8 WARN      
codecparsers_h264 gsth264parser.c:2219:gst_h264_parser_parse_slice_hdr:
error parsing "Slice header"



-----
------------------------------
Gstreamer 1.14.1
------------------------------
Windows
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.14.1
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: Memory Leak?

killerrats

rtspsrc location=[IP] name=source ! rtpjitterbuffer ! rtph264depay ! h264parse ! queue name=queue1 leaky=true ! mux.video splitmuxsink async-handling=true max-size-bytes=10485760 max-files=360 muxer=avimux location=D:/VideoStorageSplit2/video%06d.avi name=mux source. ! rtpjitterbuffer ! rtpmp4gdepay ! aacparse ! queue name=queue2 leaky=true ! mux.audio_0

So I ended up adding some properties to the application. The memory seemed to shoot up to 77mb.

properties i set:
g_object_set(GST_OBJECT(pipe->rtpjitterbuffer1)
, "do-lost", TRUE
,"max-dropout-time",static_cast(20000)
,"rtx-max-retries",5
, nullptr);
g_object_set(GST_OBJECT(pipe->rtpjitterbuffer2)
, "do-lost", TRUE
, "max-dropout-time", static_cast(20000)
, "rtx-max-retries", 5
, nullptr);
g_object_set(GST_OBJECT(pipe->queue1)
, "leaky",2
,"flush-on-eos", TRUE
, nullptr);
g_object_set(GST_OBJECT(pipe->queue2)
, "leaky", 2
,"flush-on-eos", TRUE
, nullptr);

Element Name current-level-buffers current-level-bytes current-level-time
queue1 , 48693 , 17749538 , 4522319740088
queue2 , 0 , 0 , 4522319740088
1 Second later Check:
queue1 , 48703 , 17753183 , 4523247721948
queue2 , 0 , 0 , 4523247721948
1 Second later Check:
queue1 , 48714 , 17757192 , 4524269640878
queue2 , 0 , 0 , 4524269640878

------------------------------
Gstreamer 1.14.1
------------------------------
Windows


Sent from the GStreamer-devel mailing list archive at Nabble.com.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.14.1
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: Memory Leak?

killerrats

rtspsrc location=[IP] name=source ! rtpjitterbuffer name=rtpjitterbuffer1 ! rtph264depay name=vdepay ! h264parse name=vparse config-interval=1 ! multiqueue max-size-time=0 name=mq ! mux.video splitmuxsink name=splitmuxsink async-handling=true max-size-bytes=1048576 max-files=360 muxer=avimux location=D:/VideoStorageSplit2/video%06d.avi mq. ! splitmuxsink.audio_1 source. ! rtpjitterbuffer name=rtpjitterbuffer2 ! rtpmp4gdepay name=adepay ! aacparse name=aparse ! mq.

so I tried a new approach by using MULTIQUEUE. after 4 days of running constantly it still ran into the problem of increased in memory. anybody have any idea how to figure out why it does that? or how I can figure out why it does that? If i run a eos through the pipeline but it only has a portion out of the max file size i set. The file cannot be played.
------------------------------
Gstreamer 1.14.1
------------------------------
Windows


Sent from the GStreamer-devel mailing list archive at Nabble.com.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.14.1
------------------------------
Windows
Reply | Threaded
Open this post in threaded view
|

Re: Memory Leak?

killerrats

rtspsrc location=[IP] name=source ! rtpjitterbuffer name=rtpjitterbuffer1 ! rtph264depay name=vdepay ! h264parse name=vparse config-interval=1 ! multiqueue max-size-time=0 name=mq ! fakesink name=fakesink1 mq. ! fakesink name=fakesink2 source. ! rtpjitterbuffer name=rtpjitterbuffer2 ! rtpmp4gdepay name=adepay ! aacparse name=aparse ! mq.

I put together this pipeline and lasted for 3-4 days but quit immediately. The error in the pipeline was stream timeout. Could that actually not reach the splitmuxsink and make it increase memory making it not stop?

109:36:16.290710734 55172 03359998 WARN rtspsrc gstrtspsrc.c:3151:on_timeout: source 805bacc4, stream 805bacc4 in session 1 timed out
109:36:18.297746384 55172 033599C0 WARN rtspsrc gstrtspsrc.c:3151:on_timeout: source 805bacc3, stream 805bacc3 in session 0 timed out
Got EOS from element "pipeline0".
Execution ended after 109:36:18.012863821
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
109:36:18.312780510 Setting pipeline to NULL 55172...
033238E8 WARN rtspsrc gstrtspsrc.c:5915:gst_rtsp_src_receive_response: receive interrupted
109:36:18.318988152 55172 033238E8 WARN rtspsrc gstrtspsrc.c:8242:gst_rtspsrc_pause: PAUSE interrupted
Freeing pipeline ...

------------------------------
Gstreamer 1.14.1
------------------------------
Windows


Sent from the GStreamer-devel mailing list archive at Nabble.com.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
------------------------------
Gstreamer 1.14.1
------------------------------
Windows