View Single Post
  #13   Spotlight this post!  
Unread 08-04-2015, 17:04
Bryan Herbst's Avatar
Bryan Herbst Bryan Herbst is offline
Registered User
AKA: Bryan
FRC #2052 (KnightKrawler)
Team Role: Mentor
 
Join Date: Sep 2007
Rookie Year: 2007
Location: Minneapolis, Minnesota
Posts: 544
Bryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond reputeBryan Herbst has a reputation beyond repute
Re: Javascript Robots!

Quote:
Originally Posted by AlexanderTheOK View Post
That explains the 250ms lag spikes I've been seeing every once in a while. Any standard way to mitigate this?
Memory management is complicated, so there isn't really a silver bullet you can apply to make it better. To minimize garbage collection, you need to understand why things get garbage collected and why things don't get garbage collected.

Garbage collection generally occurs when Java decides it needs more memory for new allocations. Objects that are no longer referenced are eligible to be collected.

If you feel as though the garbage collector is running too often, it is likely because you are allocating too many objects too frequently. For example, if you have a loop that creates a new instance of an object in every iteration, those objects can pile up quickly.
__________________
Team 2052- Knightkrawler
Mentor and volunteer

Last edited by Bryan Herbst : 09-04-2015 at 09:44.