discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] scope too slow?


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] scope too slow?
Date: Tue, 22 Feb 2005 14:31:57 -0800
User-agent: Mutt/1.5.6i

On Tue, Feb 22, 2005 at 11:39:59PM +0530, Ramakrishnan Muthukrishnan wrote:
> 
> I ran the following code and it just crawls my Athlon64 2Ghz to halt.
> 'top' shows that the memory usage goes on increasing and increasing.
> Anyone else experiencing the same problem? Is there anything wrong
> I am doing here? The code is given below.

The code below will never block waiting for anything, hence it will
consume all CPU available.  On my machine the CPU utilization is split
about 70/30 between python and the X server.

On my Pentium M the memory consumption does not increase, but stays
steady with a resident size of 46M according to top.  I let it run for
about 5 minutes.

If your memory consumption is increasing there must be a leak
somewhere.  It's worth tracking down, but could be tricky.
I'd start reducing the test case until the leaking stopped.
E.g., remove the GUI and use a gr.null_sink instead.

Eric


> #!/usr/bin/python
> # copyright (c) 2005, FSF under the GNU GPL v2 or later
> # Author: Ramakrishnan Muthukrishnan <address@hidden>
> #
> 
> from gnuradio import gr
> from gnuradio import audio
> from gnuradio.wxgui import stdgui, fftsink, scopesink
> import sys
> import os
> import wx
> 
> class app_flow_graph (stdgui.gui_flow_graph):
>     def __init__(self, frame, panel, vbox, argv):
>         stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)
> 
>         sampling_freq = 8000
> 
>         # create a probe
>         #block, fft_win = fftsink.make_fft_sink_f (self, panel, "Spectrum", 
> 2048, sampling_freq)
>         block, scope_win = scopesink.make_scope_sink_f (self, panel, 
> "time_domain", sampling_freq)
> 
>         src = gr.sig_source_f (sampling_freq,gr.GR_SIN_WAVE,2100,1.0,0) 
> 
>         n_taps = 201
>         hilbert = gr.hilbert_fc (n_taps)
> 
>         real = gr.complex_to_real()
>         imag = gr.complex_to_imag()        
> 
>         self.connect (src, hilbert)
>         self.connect (hilbert, real)
>         self.connect (hilbert, imag)
> 
>         self.connect (real, (block,0))
>         self.connect (imag, (block,1))        
>         vbox.Add (scope_win, 1, wx.EXPAND)
> 
> if __name__ == '__main__':
>     app = stdgui.stdapp (app_flow_graph, "Spectrum")
>     app.MainLoop ()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]