Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

maintaining

Name: Anonymous 2011-09-26 22:06

So /prog/ I'm left to maintain a whole heap of java code. I probably should profile it because i've already spotted random memory leaks from time to time and bad performance hits.


Before i do any of that should i take the time to go through each file individually and slowly but painfully fix errors i can spot on the fly or should i just get out of a profiler and have it tell me where to look?

Also i've noticed this code makes heavy use of a vector class and all the vector operations stored per object create another vector object and sometimes there's a combination of 6 vector operations just to get the final request which means 6 new objects created/deallocated in that time. Would it be wise to redo this so that it doesn't allocate/deallocate tons and tons of temp objects which will only be used for another nanosecond then left for the GC each frame?

Name: Anonymous 2011-09-26 23:10

>it be wise to redo this so that it doesn't allocate/deallocate tons and tons of temp objects

Name: Anonymous 2011-09-27 7:27

>>1
Also i've noticed this code makes heavy use of a vector class and all the vector operations stored per object create another vector object and sometimes there's a combination of 6 vector operations just to get the final request which means 6 new objects created/deallocated in that time.
Sigh, shouldn't the JVM JIT optimize this? I don't know, I've never dealt with Java (thankfully!).

Name: Anonymous 2011-09-27 15:09

fix errors i can spot
No, something will rely on the errors.

Name: Anonymous 2011-09-27 15:14

>>1
Do a Test Driven Autopsy.

Name: Anonymous 2011-09-27 15:20

a whole heap of java code
I hope that heap is implemented with a linked list.

Name: Anonymous 2011-09-27 15:23

Yeah, the first thing you do with legacy code is make sure it's all under version control. Then you write a buttload of tests, in the process figuring out how the implementation diverges from whatever documentation you have.
Then you can start fixing shit.

Name: Anonymous 2011-09-27 15:51

How do you leak memory in a GCed language?

Name: Anonymous 2011-09-27 15:58

>>1
Java
performance hit
Consider rewriting it in non-GC language

>>8
Try Google. It's quite easy actually, happens all the time.

Name: Anonymous 2011-09-28 1:30

>>8
logical leaks

>>1
does "maintain" mean "optimize" now?

Name: Xarn 2011-09-28 6:59

SLACKWARESUPREMACYSLACKWARESUPREMACYSLACKWARESUPREMACYSLACKWARESUPREMACY

Don't change these.
Name: Email:
Entire Thread Thread List