Csound Csound-dev Csound-tekno Search About

[Csnd-dev] memory issue with chnget...

Date2017-06-06 11:32
FromRory Walsh
Subject[Csnd-dev] memory issue with chnget...
If you called csoundGetChannelPtr() with an empty channel string you end up memory leaks. It seems that create_new_channel() will be called over and over again, allocating memory each time. I've attached an example. Can we guard against this? 

Date2017-06-06 11:34
FromRory Walsh
SubjectRe: [Csnd-dev] memory issue with chnget...
Attachmentschnget.csd  exampleChngetEmpty.cpp  
Sorry, I sent that before I finished. I know this is something that host developers should check for before calling chnget(), but if there is no perf hit on the Csound side, perhaps we can do the check there?

On 6 June 2017 at 11:32, Rory Walsh <rorywalsh@ear.ie> wrote:
If you called csoundGetChannelPtr() with an empty channel string you end up memory leaks. It seems that create_new_channel() will be called over and over again, allocating memory each time. I've attached an example. Can we guard against this? 


Date2017-06-06 11:58
FromVictor Lazzarini
SubjectRe: [Csnd-dev] memory issue with chnget...
Do you mean csound->GetChannel("d”) is causing a leak? I see no csoundGetChannelPtr() in your code.

In any case, csoundReset() will clear the memory, would it not? Do you mean “unwanted memory growth” rather
than a leak?

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 6 Jun 2017, at 11:34, Rory Walsh  wrote:
> 
> Sorry, I sent that before I finished. I know this is something that host developers should check for before calling chnget(), but if there is no perf hit on the Csound side, perhaps we can do the check there?
> 
> On 6 June 2017 at 11:32, Rory Walsh  wrote:
> If you called csoundGetChannelPtr() with an empty channel string you end up memory leaks. It seems that create_new_channel() will be called over and over again, allocating memory each time. I've attached an example. Can we guard against this? 

Date2017-06-06 14:50
FromRory Walsh
SubjectRe: [Csnd-dev] memory issue with chnget...
Yeah I meant csound->GetChannel(""), which in turn calls csoundGetChannelPtr(). (I try to quote the C functions for John, it tends to get his attention quicker!)  And yes, "unwanted memory growth" is perhaps a better term.

On 6 June 2017 at 11:58, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Do you mean csound->GetChannel("d”) is causing a leak? I see no csoundGetChannelPtr() in your code.

In any case, csoundReset() will clear the memory, would it not? Do you mean “unwanted memory growth” rather
than a leak?

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 6 Jun 2017, at 11:34, Rory Walsh <rorywalsh@ear.ie> wrote:
>
> Sorry, I sent that before I finished. I know this is something that host developers should check for before calling chnget(), but if there is no perf hit on the Csound side, perhaps we can do the check there?
>
> On 6 June 2017 at 11:32, Rory Walsh <rorywalsh@ear.ie> wrote:
> If you called csoundGetChannelPtr() with an empty channel string you end up memory leaks. It seems that create_new_channel() will be called over and over again, allocating memory each time. I've attached an example. Can we guard against this?
>
> <chnget.csd><exampleChngetEmpty.cpp>



Date2017-06-06 14:58
FromVictor Lazzarini
SubjectRe: [Csnd-dev] memory issue with chnget...
I can add a check for an empty string if that helps.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 6 Jun 2017, at 14:50, Rory Walsh  wrote:
> 
> Yeah I meant csound->GetChannel(""), which in turn calls csoundGetChannelPtr(). (I try to quote the C functions for John, it tends to get his attention quicker!)  And yes, "unwanted memory growth" is perhaps a better term. 
> 
> On 6 June 2017 at 11:58, Victor Lazzarini  wrote:
> Do you mean csound->GetChannel("d”) is causing a leak? I see no csoundGetChannelPtr() in your code.
> 
> In any case, csoundReset() will clear the memory, would it not? Do you mean “unwanted memory growth” rather
> than a leak?
> 
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 6 Jun 2017, at 11:34, Rory Walsh  wrote:
> >
> > Sorry, I sent that before I finished. I know this is something that host developers should check for before calling chnget(), but if there is no perf hit on the Csound side, perhaps we can do the check there?
> >
> > On 6 June 2017 at 11:32, Rory Walsh  wrote:
> > If you called csoundGetChannelPtr() with an empty channel string you end up memory leaks. It seems that create_new_channel() will be called over and over again, allocating memory each time. I've attached an example. Can we guard against this?
> >
> > 

Date2017-06-06 15:14
FromRory Walsh
SubjectRe: [Csnd-dev] memory issue with chnget...
That should do the trick. Go raibh maith agat ;)  

On 6 June 2017 at 14:58, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
I can add a check for an empty string if that helps.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 6 Jun 2017, at 14:50, Rory Walsh <rorywalsh@ear.ie> wrote:
>
> Yeah I meant csound->GetChannel(""), which in turn calls csoundGetChannelPtr(). (I try to quote the C functions for John, it tends to get his attention quicker!)  And yes, "unwanted memory growth" is perhaps a better term.
>
> On 6 June 2017 at 11:58, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> Do you mean csound->GetChannel("d”) is causing a leak? I see no csoundGetChannelPtr() in your code.
>
> In any case, csoundReset() will clear the memory, would it not? Do you mean “unwanted memory growth” rather
> than a leak?
>
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 6 Jun 2017, at 11:34, Rory Walsh <rorywalsh@ear.ie> wrote:
> >
> > Sorry, I sent that before I finished. I know this is something that host developers should check for before calling chnget(), but if there is no perf hit on the Csound side, perhaps we can do the check there?
> >
> > On 6 June 2017 at 11:32, Rory Walsh <rorywalsh@ear.ie> wrote:
> > If you called csoundGetChannelPtr() with an empty channel string you end up memory leaks. It seems that create_new_channel() will be called over and over again, allocating memory each time. I've attached an example. Can we guard against this?
> >
> > <chnget.csd><exampleChngetEmpty.cpp>
>
>



Date2017-06-06 15:39
FromVictor Lazzarini
SubjectRe: [Csnd-dev] memory issue with chnget...
Níl a bhuíochas ort. It’s in git develop now.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 6 Jun 2017, at 15:14, Rory Walsh  wrote:
> 
> That should do the trick. Go raibh maith agat ;)  
> 
> On 6 June 2017 at 14:58, Victor Lazzarini  wrote:
> I can add a check for an empty string if that helps.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
> 
> > On 6 Jun 2017, at 14:50, Rory Walsh  wrote:
> >
> > Yeah I meant csound->GetChannel(""), which in turn calls csoundGetChannelPtr(). (I try to quote the C functions for John, it tends to get his attention quicker!)  And yes, "unwanted memory growth" is perhaps a better term.
> >
> > On 6 June 2017 at 11:58, Victor Lazzarini  wrote:
> > Do you mean csound->GetChannel("d”) is causing a leak? I see no csoundGetChannelPtr() in your code.
> >
> > In any case, csoundReset() will clear the memory, would it not? Do you mean “unwanted memory growth” rather
> > than a leak?
> >
> > ========================
> > Prof. Victor Lazzarini
> > Dean of Arts, Celtic Studies, and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> > > On 6 Jun 2017, at 11:34, Rory Walsh  wrote:
> > >
> > > Sorry, I sent that before I finished. I know this is something that host developers should check for before calling chnget(), but if there is no perf hit on the Csound side, perhaps we can do the check there?
> > >
> > > On 6 June 2017 at 11:32, Rory Walsh  wrote:
> > > If you called csoundGetChannelPtr() with an empty channel string you end up memory leaks. It seems that create_new_channel() will be called over and over again, allocating memory each time. I've attached an example. Can we guard against this?
> > >
> > > 

Date2017-06-06 15:50
FromRory Walsh
SubjectRe: [Csnd-dev] memory issue with chnget...
All good now. Cheers. 

On 6 June 2017 at 15:39, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Níl a bhuíochas ort. It’s in git develop now.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 6 Jun 2017, at 15:14, Rory Walsh <rorywalsh@ear.ie> wrote:
>
> That should do the trick. Go raibh maith agat ;)
>
> On 6 June 2017 at 14:58, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> I can add a check for an empty string if that helps.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
> > On 6 Jun 2017, at 14:50, Rory Walsh <rorywalsh@ear.ie> wrote:
> >
> > Yeah I meant csound->GetChannel(""), which in turn calls csoundGetChannelPtr(). (I try to quote the C functions for John, it tends to get his attention quicker!)  And yes, "unwanted memory growth" is perhaps a better term.
> >
> > On 6 June 2017 at 11:58, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
> > Do you mean csound->GetChannel("d”) is causing a leak? I see no csoundGetChannelPtr() in your code.
> >
> > In any case, csoundReset() will clear the memory, would it not? Do you mean “unwanted memory growth” rather
> > than a leak?
> >
> > ========================
> > Prof. Victor Lazzarini
> > Dean of Arts, Celtic Studies, and Philosophy,
> > Maynooth University,
> > Maynooth, Co Kildare, Ireland
> > Tel: 00 353 7086936
> > Fax: 00 353 1 7086952
> >
> > > On 6 Jun 2017, at 11:34, Rory Walsh <rorywalsh@ear.ie> wrote:
> > >
> > > Sorry, I sent that before I finished. I know this is something that host developers should check for before calling chnget(), but if there is no perf hit on the Csound side, perhaps we can do the check there?
> > >
> > > On 6 June 2017 at 11:32, Rory Walsh <rorywalsh@ear.ie> wrote:
> > > If you called csoundGetChannelPtr() with an empty channel string you end up memory leaks. It seems that create_new_channel() will be called over and over again, allocating memory each time. I've attached an example. Can we guard against this?
> > >
> > > <chnget.csd><exampleChngetEmpty.cpp>
> >
> >
>
>