Memory issue on Hardware Acceralation & Skipping

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Memory issue on Hardware Acceralation & Skipping

#1 Post by nyaatrap » Fri Mar 29, 2013 9:27 am

I've been struggling ren'py's memory issue, and recently found there are 2 factors: hardware acceleration, and skipping.
Problem here is, hardware acceleration is system dependent. So I think I'd put my result here to ask someone to join investigating this issue further.

Firstly, This is the file I'm using to investigate memory issue:
memory_test.zip
(1023.81 KiB) Downloaded 28 times
After you launched it, press Tab key. Then image loading starts.
The code is following:

Code: Select all

init python:
    config.skip_delay = 0
    config.image_cache_size = 0
    
label splashscreen:
    jump start
    
label start:
    while True:
        python:
            for l in ["60", "50", "40"]:
                for k in ["1","2", "3"]:
                    for j in ["1","2","3","4","5", "6"]:
                        for i in ["a", "b", "c", "f", "l", "n", "p", "s", "z" ]:
                            renpy.scene()                        
                            renpy.show("image", at_list=[truecenter], what=im.Composite((935,1280),
                                (0,0), "large/rio%s.png"%l, (0,0), "large/rio_%s.png"%i,
                                (0,0), "large/rio_x%s.png"%j, (0,0), "large/rio_xx%s.png"%k))
                            narrator("")
I tried various combination of config.skip_delay and config.image_cache_size, changing software/hardware renderer.
The following data is with Windows 7, Core i3, Intel HD graphics 4000 (the driver version is 2013 one)
・When I use software renderer, and skip_delay = 200, and image_cache_size=0, RAM usage is stable around 70~90MB.
・When I use software renderer, and skip_delay = 25 (default), and image_cache_size = 0, It never release RAM and crashes soon.
・When I use hardware renderer, skip_delay = 25, image_cache_size=0, It's stable at 170~190MB. But when I minimize the window, it becomes 100mMB.
・When I use hardware renderer, skip_delay = 25, image_cache_size=8(default), It's stable around 400MB. But when I minimize the window, it becomes 100MB.
・When I use hardware renderer, skip_delay =0, image_cache_size = 0, It never release RAM and crashes soon. This setting also has interesting result. When I stop skipping before crash, like 1600MB usage, it becomes 800MB. And this 800MB becomes permanent RAM usage even I reload the game, restart the game, e.t.c. But when I minimize the window, it becomes 100MB.

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4067
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Memory issue on Hardware Acceralation & Skipping

#2 Post by jack_norton » Fri Mar 29, 2013 9:38 am

Tried it on my PC which is similar to yours:
Windows 7, Core i3, ATi Radeon 4670 in HW accelerated mode
on 6.15 - memory goes up, if I stop skipping "some" of it gets released, seems 50%
on 6.13 & 6.14 - the memory usage was going always up even if I stopped skipping, so it means the bug was present also in previous version and is not a new thing of the latest update
follow me on Image Image Image
computer games

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Memory issue on Hardware Acceralation & Skipping

#3 Post by PyTom » Sat Mar 30, 2013 12:39 pm

I'm unable to reproduce this on 6.15.3.

6.15.3 will kick off the preload thread in a lot more cases, so I think it's at least possible it may have fixed this bug.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4067
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Memory issue on Hardware Acceralation & Skipping

#4 Post by jack_norton » Sat Mar 30, 2013 12:47 pm

Not sure if can help, in my case I didn't use the SKIP button, since skipping didn't advance the frames, I pressed the spacebar quickly and noticed the memory kept increasing until I stopped it.
follow me on Image Image Image
computer games

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Memory issue on Hardware Acceralation & Skipping

#5 Post by nyaatrap » Sat Mar 30, 2013 7:59 pm

Tested with my game AAA. With 6.15.2, it consumed 1000~1500 MB. But now with 6.15.3, it's stable around 900 MB. It improved significantly :D

Post Reply

Who is online

Users browsing this forum: No registered users