Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
JavaDebuggingHints
Edit
PageHistory
Diff
Info
LikePages
[Java] is immunne some of the [Stack] and [Heap] overwriting issues that arise in languages such as [AssemblyLanguage], [C] and [C++] and described on the excellent AdvancedDebuggingHints page. There are, however, a different set of common issues that arise: !! Threading All [Java] [GUI] programs are MultiThreaded, with at least a thread for each window, a thread for the GarbageCollection, a main thread, as well as those explicitly started. Testing such programs is non-trivial. Typically the solution is to have data accessed through accessors (small methods / functions which get or set data values) and have these accessors perform locking on the data. Most [JVM]s output significant information when a deadlock occurs and this can enable debugging. !! Internationalisation Java uses [Unicode] throughout and bad habits learnt with [ASCII], and which work for English [Unicode], break completely when you encountered real [Unicode]. Generally any single quoted characters ('c') need to be looked at very closely. !! GarbageCollection GarbageCollection systems and algorithms can have bugs, but the systems in most [JVM]s are mature and stable. Unless you're doing incredible numbers of calls to [JNI] code, the bug is almost certainly in your code. Several of the [JVM]s provide memory [Profiling] which appears to be useful in a significant number of non-pathological cases.
No page links to
JavaDebuggingHints
.