Love2d stops running after awhile

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Love2d stops running after awhile

Post by zorg »

Nixola wrote: Sat Dec 19, 2020 10:43 pm Note that the love.lowmemory callback exists and is designed for this kind of issue, if memory is to blame.
Callback function triggered when the system is running out of memory on mobile devices.
Unless the wiki's wrong, it won't work on desktop.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Love2d stops running after awhile

Post by Gunroar:Cannon() »

Wow, thnx for all the useful replies. I checked back it didn't seem to affect the multiplayer aspect anymore. Must have been a different problem.
zorg wrote: Sun Dec 20, 2020 1:36 am
Nixola wrote: Sat Dec 19, 2020 10:43 pm Note that the love.lowmemory callback exists and is designed for this kind of issue, if memory is to blame.
Callback function triggered when the system is running out of memory on mobile devices.
Unless the wiki's wrong, it won't work on desktop.
Oh that's fine as it's a mobile game I'm designing.

But sometimes if I collectgarbage("collect") multiple times(and it does have an effect, lowering 200 or so mb to 123) the game still closes(and at an fps of 4 :P). So a few more questions if you may...
1)can it overwhelm the system and crash??
2)If it manages to still collect a large amount of data does it still have a memory leak???
3)Is there any other reason a love2d game may just close on android besides due to memory(since love.lowmemory doesn't seemed to be called)????
At this point I feel like quitting but I've worked on it for so long and got past many hurdles but this. Also when I call collectgarbage on love.lowmemory it still crashes ... anymore thoughts? I'm stuck.
PS: If ran long enough it closes on the tablet too.
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Love2d stops running after awhile

Post by Gunroar:Cannon() »

Helloooooooooooooooooo...? I'm still stuck and I have a feeling the problem isn't from memory...
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
MrFariator
Party member
Posts: 509
Joined: Wed Oct 05, 2016 11:53 am

Re: Love2d stops running after awhile

Post by MrFariator »

You haven't posted code or any additional information that might help solving the issue, so there isn't much to say. If you don't want to share your project or relevant snippets, you can disable most of the game's logic code (by commenting them out in love.update or wherever else), and then step-by-step enable behavior and see when the issues crop up again. That should help you along with narrowing down the issue.

However, on collectcarbage("collect"), yes, it will affect your performance, because you're not really encouraged to run it too often. Calling it won't magically fix a memory leak, because that memory might still be referenced somewhere, and thus prevent gc from collecting it.
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Love2d stops running after awhile

Post by Gunroar:Cannon() »

Thnxks for the reply, though how about my other non-game specific questions (No.2 and , especially, 3). I can't post my code, not because I don't want to but the browser I'm using is oldish. It took me forever to sign up. (Can't change it due to lack of data, the browser gives me data for free). And I can't type it cause it's too...looooong.
So ...
2)If it manages to still collect a large amount of data does it still have a memory leak???
Even when I don't call it manually the count goes to 200 then 130 then 250 then back to 130mb. Does it still have a memory leak since the numbers are do far apart?

3)Is there any other reason a love2d game may just close( on android) besides due to memory(since love.lowmemory doesn't seemed to be called at all before it closes)????
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Love2d stops running after awhile

Post by pgimeno »

(2) If the lowest count does not get bigger and bigger, you don't have a leak.

(3) The only other reason for closing that I can think of, is that you're triggering a bug that causes a segfault or some other kind of crash. I doubt it, though.
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Love2d stops running after awhile

Post by Gunroar:Cannon() »

Edited:
hmmm...thnks, I guess. I guess I have no choice to post my wonderful (i.e Messy) source code. But before that I'll try a few things which I will post if it they work. So be watching for when I post an answer or the .love file. Though it's android based.
Last edited by Gunroar:Cannon() on Thu Dec 24, 2020 6:42 pm, edited 1 time in total.
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
pgimeno
Party member
Posts: 3544
Joined: Sun Oct 18, 2015 2:58 pm

Re: Love2d stops running after awhile

Post by pgimeno »

Gunroar:Cannon() wrote: Wed Dec 23, 2020 11:38 pm Thnxks for the reply, though how about my other non-game specific questions (No.2 and , especially, 3). I can't post my code, not because I don't want to but the browser I'm using is oldish.
That shouldn't be an impediment, unless "oldish" means a Netscape version that precedes the time of the invention of file fields in forms, but I doubt it. phpBB surely pre-dates that browser.

Try with JavaScript disabled, it works for me. This is the view I get with JS disabled:
PostForm-attach.png
PostForm-attach.png (24.67 KiB) Viewed 6260 times
Click "Browse" to select the file, then "Add the file" to attach it, then "Submit" to post the message with the file attached. I've highlighted these buttons above.

Some people have reported that they need to use a .zip extension or it won't work for them, so you can try that too if you still have trouble.
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Love2d stops running after awhile

Post by Gunroar:Cannon() »

Haha, thnx. I bet it will work when/if I try, though I might not need to post the code :P.
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Love2d stops running after awhile

Post by Gunroar:Cannon() »

Hey!Hey!Hey!...I was thinking, before I try anything rash, can a low fps(like 1 or ... 0) cause the app to crash/exit?
Because when I test it it freezes for awhile before exiting.
Thnx in advance.
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 38 guests