Thread: Client.java size does not lagg your server.

Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 43
  1. #11  
    Renown Programmer

    Nikki's Avatar
    Join Date
    Aug 2008
    Posts
    3,993
    Thanks given
    553
    Thanks received
    1,077
    Rep Power
    5000
    Quote Originally Posted by Java` View Post
    I just worked this out. If you have 2000 players online, and your Client.java is 2MB (thats the biggest freakin thing ever, i doubt ANY server has one over 1MB)

    (2000 players * 2MB = 4000MB) / 1024 = 3.9GB

    The runescape servers probably have like 40GB RAM, and i doubt and server here has that many players anyway. What uses up your RAM is the "byte[] buffer". This is a byte[] used to store all information in until it it written out to the client once per 600ms. There may be up to 3 buffers, each being tens of thousands of bytes in size. Think, new byte[70000]. One for client.java, one for outStream, and one for inStream. Plus, a new one possibly even bigger for the players update block. Thats where your memory goes.


    Things that cause lagg:

    Process being large. It should be like maybe 20 lines max.
    A bug in winterLove causes process to be repeated for EVERY packet sent. So if a player clicks 5 times in one cycle, it repeats process 5 times.

    To many NPC's. They have to be processed just like players, and in winterLove, it checks like 50 ID's for every NPC for talking above their heads, and for fighting, e.c.t.

    Bugged code.
    This is the major thing. wL has tons of unnecessary code. Sometimes methods repeat over and over for no reason.

    Large parseIncomingPackets() method.
    If you click an object, it has to go through maybe 2-3k if statements to find the right object ID you clicked on.

    wL is such a reused source for bases. there are so many things that you never even knew about in there. Try reading through client.java. 90% of it will be stuff never used, or used for no reason.

    Maybe you guys can fix it now. All this doesn't mean wL is crap. Its a much reused source, thats collected junk over time. My own 317 and 474 servers are wL type, and they certainly don't have these type of issues.
    The 40gb Ram is incorrect, They use maybe 15gb, Because remember, They have PRO Coders, Not simple java, Also they have way better ways of doing it, because they created it first.
    Please don't add/pm me asking for RSPS help!

    Links:
    - [Only registered and activated users can see links. ]
    - [Only registered and activated users can see links. ]

     

  2. #12  
    Respected Member


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    32
    Posts
    12,549
    Thanks given
    177
    Thanks received
    5,784
    Discord
    View profile
    Rep Power
    5000
    BattleScape 317's client.java was 1.3mb, and there are numerous servers with one over 1mb.

     

  3. #13  
    Donator


    Join Date
    Mar 2008
    Posts
    1,945
    Thanks given
    118
    Thanks received
    201
    Rep Power
    2104
    and if i remember old battlescape was laggy like not other back in the day
     

  4. #14  
    Respected Member


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    32
    Posts
    12,549
    Thanks given
    177
    Thanks received
    5,784
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by lmctruck30 View Post
    and if i remember old battlescape was laggy like not other back in the day
    BattleScape and BattleScape Isle were the same server, he didn't rewrite it or anything..

     

  5. #15  
    Donator


    Join Date
    Mar 2008
    Posts
    1,945
    Thanks given
    118
    Thanks received
    201
    Rep Power
    2104
    Quote Originally Posted by Luke132 View Post
    BattleScape and BattleScape Isle were the same server, he didn't rewrite it or anything..
    i didnt know that

    i just remember battlescape always down and boratscape getting most of their players back then
     

  6. #16  
    Registered Member

    Join Date
    Jun 2007
    Posts
    2,237
    Thanks given
    267
    Thanks received
    411
    Rep Power
    1283
    This is so easy to test.
    use Runtime.getRuntime().getFreeMemory() when the server starts then when a player logs in and logs out(After using the garbage control) to see the memory the player used.
    Don't worry, Be happy.
     

  7. #17  
    Community Veteran


    Join Date
    Jan 2008
    Posts
    2,664
    Thanks given
    493
    Thanks received
    627
    Rep Power
    980
    To put it simply, the performance of a program depends on (talking software-level) the amount and size of processes, and also the amount and size of threads.

    As long you don't change the runtime of a class, adding even a million methods to it won't change the performance.
    ~iKilem
     

  8. #18  
    Banned

    Join Date
    Sep 2006
    Age
    28
    Posts
    3,019
    Thanks given
    22
    Thanks received
    420
    Rep Power
    0
    Quote Originally Posted by Boomer View Post
    That statement is false, it depends what makes your client class large. If you have a 1MB process void then that would slow down the server.
    That statement is also false. Depending on what the method actually does, a huge method could easily process within a millisecond.
     

  9. #19  
    Registered Member

    Join Date
    Oct 2007
    Posts
    2,413
    Thanks given
    254
    Thanks received
    479
    Rep Power
    2785
    I seriously want to flame every single one of you right now about how retarded your posts are. But instead I will take the time out of my priceless day to explain to you kind people of rune-server, what really makes process times slow.

    First of all, jagex hosts 2 worlds per computer, they don't have near 10GB of ram, because they are not retarded morons and they don't write useless and heavy-weight scripts that will hog lots of memory. One server(computer) that jagex uses to host two worlds, maybe has about 4-6GB of ram, (I believe jagex uses redhat linux for hosting), you guys know nothing about the difference between RAM and CPU, RAM can easily be increased by creating a PAGE on your harddrives, a PAGE is a block of memory stored on your harddrive that acts like it was RAM. I have 4 harddrives, and i CAN have each one store it's own PAGE block. If I did, I would have like 21GB of ram, but sinces Windows XP only handles like 3GB of ram, all I need is the hardram (sticks on my motherboard) because I have 2.37GB of hardram. If I wanted to, I could switch OS's and have 21GB of ram, but it's not needed and wont speed anything up.

    The real thing is CPU, the more GigaHertz(GHz) the faster threads will be processed. So honestly jagex has around 4-6GB of ram, and atleast 5.0GHz. Reason why jagex can handle 4096 connections on one computer, is not only because of the computers specs (RAM+CPU), but because jagex pays a shit load (ruffly guessing about $10,000++ a month for the internet), because they have Telnet Coms, internet, if you wish go check a speed test for Telnet Coms. Thus, making all the input/output events transfer so fast that if you were to go as fast as the data being transfered, you would be ripped apart into a million tiny bits.

    You people don't think that download speed matters when it comes to hosting a server? Sorry you're as wrong as obama when he said "yes we can". Download speed matters just as much as upload speed, if your download speed is bad, that means when a client sends data to the server(you), it will go slow, thus making operations slow and shitty. Honestly network speed matters more than RAM. Also, I want to just through in here, you know why 2speced has to have like 20GB of ram? Because it's a shitty written server and he needs that much memory to handle 500 players.

    Now on to what causes heavy use of memory. Buffers in blocking i/o are filled, but are not sized correctly, each client class creates a static buffer for all input and output, usually like 50MB in size. Thats why when making a client/server program, to have it ensure the the capacity is only what it needs and resize when its ready to be downsized or upsized(dynamic buffer).
    You guys think thread-per-client is bad? Not at all, it's just only bad in winterlove because it was done WRONG. The more threads the better, but if you use it wrong, things will only get worse. Thread pooling is the best to handle thread-tasks that will only be alive for a short amount of time, such as i/o events and player updating every 600ms.
    And of course, the retarded processing winterlove uses, I will not explain this because pretty much everyone knows.
     

  10. #20  
    Banned

    Join Date
    Jul 2008
    Age
    26
    Posts
    5,826
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    Quote Originally Posted by Ultimate View Post
    Guys! Guys! Guys! What really causes lag are:

    (1) IO Processes, e.g - loading and saving constantly
    (2) Process timers
    (3) Large arrays e.g. int[] array = new int[999999999];
    (4) The player updating process
    (5) Not using the garbage collector at intervals/ after loading processes
    L
    two is not true, to an extent. three is not true and 5 is not true

    Quote Originally Posted by Nicole View Post
    The 40gb Ram is incorrect, They use maybe 15gb, Because remember, They have PRO Coders, Not simple java, Also they have way better ways of doing it, because they created it first.
    I know, 40 is an exaggeration. 12+

    Quote Originally Posted by Luke132 View Post
    BattleScape 317's client.java was 1.3mb, and there are numerous servers with one over 1mb.
    Point being?

    Quote Originally Posted by Realm View Post
    To put it simply, the performance of a program depends on (talking software-level) the amount and size of processes, and also the amount and size of threads.

    As long you don't change the runtime of a class, adding even a million methods to it won't change the performance.
    Exactly!

    Quote Originally Posted by Gnarly View Post
    I seriously want to flame every single one of you right now about how retarded your posts are. But instead I will take the time out of my priceless day to explain to you kind people of rune-server, what really makes process times slow.

    First of all, jagex hosts 2 worlds per computer, they don't have near 10GB of ram, because they are not retarded morons and they don't write useless and heavy-weight scripts that will hog lots of memory. One server(computer) that jagex uses to host two worlds, maybe has about 4-6GB of ram, (I believe jagex uses redhat linux for hosting), you guys know nothing about the difference between RAM and CPU, RAM can easily be increased by creating a PAGE on your harddrives, a PAGE is a block of memory stored on your harddrive that acts like it was RAM. I have 4 harddrives, and i CAN have each one store it's own PAGE block. If I did, I would have like 21GB of ram, but sinces Windows XP only handles like 3GB of ram, all I need is the hardram (sticks on my motherboard) because I have 2.37GB of hardram. If I wanted to, I could switch OS's and have 21GB of ram, but it's not needed and wont speed anything up.

    The real thing is CPU, the more GigaHertz(GHz) the faster threads will be processed. So honestly jagex has around 4-6GB of ram, and atleast 5.0GHz. Reason why jagex can handle 4096 connections on one computer, is not only because of the computers specs (RAM+CPU), but because jagex pays a shit load (ruffly guessing about $10,000++ a month for the internet), because they have Telnet Coms, internet, if you wish go check a speed test for Telnet Coms. Thus, making all the input/output events transfer so fast that if you were to go as fast as the data being transfered, you would be ripped apart into a million tiny bits.

    You people don't think that download speed matters when it comes to hosting a server? Sorry you're as wrong as obama when he said "yes we can". Download speed matters just as much as upload speed, if your download speed is bad, that means when a client sends data to the server(you), it will go slow, thus making operations slow and shitty. Honestly network speed matters more than RAM. Also, I want to just through in here, you know why 2speced has to have like 20GB of ram? Because it's a shitty written server and he needs that much memory to handle 500 players.

    Now on to what causes heavy use of memory. Buffers in blocking i/o are filled, but are not sized correctly, each client class creates a static buffer for all input and output, usually like 50MB in size. Thats why when making a client/server program, to have it ensure the the capacity is only what it needs and resize when its ready to be downsized or upsized(dynamic buffer).
    You guys think thread-per-client is bad? Not at all, it's just only bad in winterlove because it was done WRONG. The more threads the better, but if you use it wrong, things will only get worse. Thread pooling is the best to handle thread-tasks that will only be alive for a short amount of time, such as i/o events and player updating every 600ms.
    And of course, the retarded processing winterlove uses, I will not explain this because pretty much everyone knows.
    Wow dude.
    1. a page file is to slow for a server. You might as well just write client.java out as a text file and load everything from it if your going to use a page. RAM is not expensive, as i've said before. I just bought 8GB DDR2 for 92$.

    2. 5.0GHz CPU? I doubt it because of the cooling cocts, but i could be wrong. Most servers have multiple slower CPU's.

    3.
    Sorry you're as wrong as obama when he said "yes we can".
    Obama sucks, yes.

    4.
    You guys think thread-per-client is bad? Not at all, it's just only bad in winterlove because it was done WRONG.
    I've been trying to explain that to the NIO freaks for months.
     

Page 2 of 5 FirstFirst 1234 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •