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 #1955

Closed
George874248 opened this issue Aug 22, 2016 · 5 comments
Closed

memory leak #1955

George874248 opened this issue Aug 22, 2016 · 5 comments
Labels
Milestone

Comments

@George874248
Copy link

@George874248 George874248 commented Aug 22, 2016

Help us to manage our issues by answering the following:

<example>
    <div>
        <div each={item in data}>
            <div name="f1">{item.name}</div>
            <div name="f2">{item.name}</div>
            <div name="f3">{item.name}</div>
            <div name="f4">{item.name}</div>
            <div name="f5">{item.name}</div>
            <div name="f6">{item.name}</div>
            <div name="f7">{item.name}</div>
        </div>
    </div>


    <script>
        this.data = []

        this.on("mount", () => {
            setInterval(() => {
                this.data = this.generate()
                this.update()
            }, 3000)
        })

        this.on("update", () => {
            console.log(this)
        })

        this.generate = () => {
            var data = [];
            for (var i = 0; i < 50;  i++) {
                //data.push(Math.random())
                data.push({name: Math.random()})
            }
            return data
        }
    </script>
</example>

if i use array of objects in my loop, array of names in object "this" grow up.

for exapmle:

1 update:
this.f1.length = 50;
this.f2.length = 50;
this.f3.length = 50;
......

2 update
this.f1.length = 100;
this.f2.length = 100;
this.f3.length = 100;
......

3 update
this.f1.length = 150;
this.f2.length = 150;
this.f3.length = 150;
......

4 update
this.f1.length = 200;
this.f2.length = 200;
this.f3.length = 200;
......
5 update
this.f1.length = 250;
this.f2.length = 250;
this.f3.length = 250;
......

it's normal?
you can use my example tag to see result in console.

@rsbondi
Copy link
Contributor

@rsbondi rsbondi commented Aug 22, 2016

This works correctly on next branch

@rsbondi rsbondi added the bug label Aug 22, 2016
@GianlucaGuarini
Copy link
Member

@GianlucaGuarini GianlucaGuarini commented Aug 23, 2016

@rsbondi can this issue be also fixed in riot2?

@GianlucaGuarini
Copy link
Member

@GianlucaGuarini GianlucaGuarini commented Aug 28, 2016

@rsbondi @rogueg this issue still exists in riot@next I have updated the memory tests and having tags with ref attributes in a loop blows up the program memory after a couple updates. To check the issue you can run $ make perf-leaks

@rogueg
Copy link
Member

@rogueg rogueg commented Sep 4, 2016

Should be fixed now.

@GianlucaGuarini
Copy link
Member

@GianlucaGuarini GianlucaGuarini commented Sep 4, 2016

glory to @rogueg 😺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.