Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leak on 8g #1210

Closed
gopherbot opened this issue Oct 18, 2010 · 2 comments
Closed

memory leak on 8g #1210

gopherbot opened this issue Oct 18, 2010 · 2 comments

Comments

@gopherbot
Copy link

by fibercut:

What steps will reproduce the problem?

package main

import (
    "fmt"
)

type Node struct {
    line   string
    unused [50]int
}

const (
    LOOPS = 300 // consume ~ 1G of RAM, increase this at your own risk
    MAX   = 30000
    STR   = "1 2 3 4 5 6 7 8 9 0"
)

func main() {
    for i := 1; i < LOOPS; i++ {
        p := new([MAX]Node)[0:MAX]
        for j := 0; j < MAX; j++ {
            p[j].line = STR
        }
        fmt.Printf("%v\n", i)
    }
}

What is the expected output?

On 64 bit Ubuntu (6g) to above program stays at a comfortable 45M memory consumption,
even for much larger values of LOOPS.

What do you see instead?

The above program consumes > 1G of RAM quickly on 32 bit systems (8g).

Which compiler are you using (5g, 6g, 8g, gccgo)?

8g

Which operating system are you using?

Linux (ubuntu)

Which revision are you using?  (hg identify)

ca4f9687cec0 release.2010-10-13.1/release

Please provide any additional information below.
@peterGo
Copy link
Contributor

peterGo commented Oct 18, 2010

Comment 1:

Is this a duplicate of issue #909?

@adg
Copy link
Contributor

adg commented Oct 19, 2010

Comment 2:

Most likely.

Status changed to Duplicate.

Merged into issue #909.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants