Re: [go-nuts] Re: Out of memory using golang.org/x/tools/go/packages

2021-07-21 Thread Robert Engels
Maybe the object itself has circular references - so it fails at the first level. > On Jul 21, 2021, at 11:25 AM, Brian Candler wrote: > > I had a brief look at the code and it doesn't appear to do that. As far as > I can see, it indents as it goes: where you start is the "top" level, and

Re: [go-nuts] Re: Out of memory using golang.org/x/tools/go/packages

2021-07-21 Thread Brian Candler
I had a brief look at the code and it doesn't appear to do that. As far as I can see, it indents as it goes: where you start is the "top" level, and it increases the indentation for each level of children. The individual dump functions write directly to the writer, not to a buffer (except

[go-nuts] Re: Out of memory using golang.org/x/tools/go/packages

2021-07-21 Thread Daniel T. Gorski
> If anyone would kindly help me find what I'm doing wrong, or at least point me to useful resources > explaining how to fix my problem, I would be reaally delighted. Maybe a look at *typex* [1,2] helps. [1] https://github.com/dtgorski/typex [2]

Re: [go-nuts] Re: Out of memory using golang.org/x/tools/go/packages

2021-07-21 Thread Robert Engels
If it is pretty printing it may need to determine the lowest level for indentation - so a depth first search - causing the entire tree to be traversed and retained before it can output anything. > On Jul 21, 2021, at 9:40 AM, Brian Candler wrote: > > But AFAICT, it should generate output as

Re: [go-nuts] Re: Out of memory using golang.org/x/tools/go/packages

2021-07-21 Thread Brian Candler
Not at all... I think this is a nice reproducible case that you should raise as an issue in the Litter repo. On Wednesday, 21 July 2021 at 16:31:17 UTC+1 mlevi...@gmail.com wrote: > Thx all for the response! > > Giving myself a (tremendous) facepalm, it was _indeed_ the use of litter > that

Re: [go-nuts] Re: Out of memory using golang.org/x/tools/go/packages

2021-07-21 Thread Levieux Michel
Thx all for the response! Giving myself a (tremendous) facepalm, it was _indeed_ the use of litter that destroyed my machine memory. Everything's working fine now. Sorry for the unnecessary noise guys. *retreating in shame* Have a great day! Le mer. 21 juil. 2021 à 16:40, Brian Candler a écrit

Re: [go-nuts] Re: Out of memory using golang.org/x/tools/go/packages

2021-07-21 Thread Brian Candler
But AFAICT, it should generate output as it runs. The fact that it doesn't generate any output at all is suspicious. On Wednesday, 21 July 2021 at 13:50:37 UTC+1 ren...@ix.netcom.com wrote: > Since litter checks for circular references it needs to keep a ref to > every object it sees. > >

Re: [go-nuts] Re: Out of memory using golang.org/x/tools/go/packages

2021-07-21 Thread Robert Engels
Since litter checks for circular references it needs to keep a ref to every object it sees. With a large tree you will run out of memory. > On Jul 21, 2021, at 7:19 AM, jake...@gmail.com wrote: > >  > The first thing I would do is remove the call to litter, and see if that > solved the

[go-nuts] Re: Out of memory using golang.org/x/tools/go/packages

2021-07-21 Thread jake...@gmail.com
The first thing I would do is remove the call to litter, and see if that solved the issue. That would tell you immediately if the problem was the litter package or the packages package. I have so specific knowledge, but it is not impossible to imagine that you are simply trying to print

[go-nuts] Re: Out of memory using golang.org/x/tools/go/packages

2021-07-21 Thread Brian Candler
The problem appears to be with litter, not with x/tools/go/packages On my machine, this hangs after "Stage B": https://play.golang.com/p/N2MTQszvnRN On Wednesday, 21 July 2021 at 11:41:39 UTC+1 mlevi...@gmail.com wrote: > Hi all, > > I'm having a very hard time with