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

Comments

Projects
None yet
4 participants
@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

This comment has been minimized.

Show comment
Hide comment
@rsbondi

rsbondi Aug 22, 2016

Member

This works correctly on next branch

Member

rsbondi commented Aug 22, 2016

This works correctly on next branch

@rsbondi rsbondi added the bug label Aug 22, 2016

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Aug 23, 2016

Member

@rsbondi can this issue be also fixed in riot2?

Member

GianlucaGuarini commented Aug 23, 2016

@rsbondi can this issue be also fixed in riot2?

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Aug 28, 2016

Member

@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

Member

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

This comment has been minimized.

Show comment
Hide comment
@rogueg

rogueg Sep 4, 2016

Member

Should be fixed now.

Member

rogueg commented Sep 4, 2016

Should be fixed now.

@GianlucaGuarini

This comment has been minimized.

Show comment
Hide comment
@GianlucaGuarini

GianlucaGuarini Sep 4, 2016

Member

glory to @rogueg 😺

Member

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