View Single Post
  #2   Spotlight this post!  
Unread 25-02-2015, 07:52
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Re: No robot code after running for a while (Java VM ran out of memory)

When the Java VM detects that it is running out of memory, the garbage collector should start trying as hard as it can to destroy unused objects, preventing you from running out of memory. You should make sure you are not somehow retaining a reference to old objects, preventing them from being garbage collected. It may also be that you are allocating memory too fast for the garbage collector to handle it, but I'm not sure if this is possible.

Another recommendation I have is that you try to reuse objects as much as possible between frames. Memory allocation is a fairly expensive operation. Especially in Java, since you cannot explicitly destruct objects, when you construct large objects in a fast loop, the garbage collector has to work very hard to destroy them, which can slow down your program.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote