We need more information on the garbage collector

As somebody who commonly runs into things like memory leaks, I’d love to have more information on the garbage collector readily available on the developer hub. There’s very little information outside of bits here and there on the developer hub that I could easily find. There’s a lot of people who don’t know anything about the garbage collector usually running into issues; most of those people don’t have access to the Dev forum or another user with knowledge on the subject. I’ve even got some veteran scripters who can’t give me a straight answer.

Most of what I know has been via word of other developers and often times they’re unable to state a confirmed yes or no about it, just guesses from experience. I’d like to have more confirmed information that is available on the Developer hub itself for anybody to easily access.

Edit: Just updated the title to make more sense in this category.

21 Likes

What is this garbage collector and how do I use it for the good of the world?

4 Likes

The garbage collector is something that cleans up dead(not-used) variables or instances(in roblox’s case). There’s a tiny bit of documentation on the lua website, but that only covers things like variables.

3 Likes

Oh so it can help reduce lag and stuff like that? Or just for organization?

1 Like

Yes, it helps prevent things like memory leaks. Using Destroy() seems to be the most common way of scheduling an instance for removal.

1 Like

Honestly don’t understand why GC isn’t properly documented as the topic is REALLY important for developers to be informed on.

The best I can think of that should help for now is this:

5 Likes

This post is actually how I found a ton of memory leaks originally. Strangely this is the only place I could find out about it.

1 Like

I have picked up a lot of information on garbage collection. It’s rather complicated and it’s annoying to work with but both using tests on my own as well as information I’ve picked up I think I can thoroughly explain how it works, how it collects values, how different data types effect the collector, and generally most of what you’d probably want to know.

I think it would be a good information to have in a devhub article but I also think making a post detailing the garbage collector (specifically in luau) would be a good thing for me to do this weekend.

I’ll post some information when I get a chance and I’ll try to answer any questions you (or others) have. For non dev-hub members who are reading this you can PM me if I don’t answer what you want to know. :smile:

4 Likes

Once again, it’s more or less something I believe should be on the developer hub, as much as I think it’d be awesome that you post on it, I believe it’d be better suited there. Not everybody has access to the developer forum, nor do they focus on it; the main place people go to learn about scripting is the developer hub. It’s very important we have as much information there as humanly possible.

1 Like

I would love for a devhub article to exist and I am definitely not opposing it at all. I just think that in the meantime it is definitely very useful information so I’m happy to share it.

I’m making a post in Community Tutorials right now containing all of the stuff I know about garbage collection.

1 Like

Ah, yeah I get you want to help as well. I didn’t mean to come off as opposing you. I look forward to your post.

I’ve created the thread! :smile:

I may be missing some information but I think I covered most of the important stuff. I may add more info in the future (or if someone brings something to my attention I will definitely add it)

2 Likes

While it’s great to have a post about garbage collection, the Developer Hub should be the point of call and single source of truth for development information.

Community Tutorials are neat, but we still need cohesive documentation.

5 Likes

Hey guys, I’ve been keeping an eye on this thread. I definitely agree – we don’t do a good enough job of talking about this topic on the Developer Hub. This is a pretty advanced and technical topic, so it will require a lot of care on our end to make sure we’re giving you the best advice possible. In the meantime, please do continue to use these community resources.

4 Likes

Can we get more advanced/technical tutorials on the DevHub? Right now the only source for more ‘pro tools’ by Roblox are only given by the community or briefly covered in API docs.

tl;dr can we get more learning resources from Roblox about more advanced stuff.

1 Like

OT: There’s an article in the works on the task scheduler, frame-by-frame execution and how to interface your game with this properly coming Soon™. Although personally I would like to be helping write these with engineers, there’s a lot of bigger fish to fry. If you have specific topics besides GC, I encourage you to make a separate thread and we can give requests the attention they deserve!

6 Likes

Thank you for your feedback, you have no idea how much it means to have some assurance that the issue is being addressed. I look forward to said documentation, could you perhaps update this thread once said resources become available?

2 Likes