Jump to content

Resource memory


IIYAMA

Recommended Posts

  • Moderators

Hey I got a question.

A friend told me onces that if you start a resource, the code(+ everything else) will be loaded in the RAM memory and it will be out of the RAM untill you stop the whole server?

Is this True or False? :?

Link to comment
How much lagg will a started and stopped resource cause with more than 1400 lines?

Because on my pc I have an overkill on (32gb ram), the server does only have 1 gb ram.

That kind of resource wont even cause a little dent of lag.

You will start to notice lag when restarting your resources when you have large files and 50.000+ lines of code.

Link to comment
  • Moderators

When I run this resource for real(not start and stop)

It will calculate the distance between bullet inpacts that hits cars or ped/players.(only when they hit)

The x y z coordinations + attacker + timestamps + mathfloor x y coordinations of the attacker.

Link to comment
Do you know where can I find some example?

I doubt there's any. But what should be made is: create wrappers for functions that needs something stored and that thing should be removed when resource is stopped on an environment ( could be a table - with some modifications ) and then run loadstring on that environment. When you needed to remove things you just needed to delete things stored in any table inside the environment where things were saved. It's not hard.

Link to comment
If you stop the resource, how do you unload the loadstring?

Things you have done with loadstring unloads automatically when you stop the resource that used it.

Hell, I didn't remember that resource code is saved in a new Lua state. If for some weird reason you need to unload some code while scripts still runs, my idea will still do the trick ( actually, it was qaisjp's idea for my download manager ).

Edited by Guest
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...