Refactor the Core project

Project:JNode Core
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

The JNode Core project is close to being too big to compile under Eclipse on 32-bit Linux.

I normally run eclipse with -Xmx1500. Today I had to add org.apache.log4j to the Core build sources, and found started having eclipse fail with OOM exceptions. I pushed eclipse to -Xmx1900 and had the same problem. Winding back to -Xmx1800, the build worked ... with lots of long GC pauses.

The most likely cause is that there is too much code in the Core project. We need to refactor it so that it takes less memory to compile. Of the top of my head, the Sun development tools could potentially be moved to a separate tools project, the CORBA support code to the Net project and the AWT and/or Swing code to the GUI project.

I don't know if this would create problems; e.g. when incorporating source updates from upstream. Perhaps Levente can comment on this and other issues, and maybe think of some alternatives if refactoring is not practical.

#1

Are you sure it's only the size of the core project and not the size of the whole codebase that is causing the problems to you?
Putting the core class library in various projects doesn't look like a good idea to me.
I'm thinking about moving the class library code out of core to a new subproject. But that might not be a solution for you.
Did you find a workaround already? Compiling JNode in Eclipse doesn't look very useful to me anyway.

#2

Addressing your points in order ...

  1. No I am not sure, but I strongly suspect so. Eclipse compiles projects one at a time, and once it has compiled the Core projects (with memory starvation), the others compile quickly. It seems like a bunch of memory gets freed after each project compiles.
  2. On the other hand, the Core project contains an awful lot of stuff that is not core to JNode; e.g. java compilers, xml libraries, corba, and so on. Moving those (and similar) non-core libraries out of Core is likely to reduce memory needed to build Core; see above.
  3. I worked around the problem by removing the log4j source code for the build.
  4. I don't build JNode images in Eclipse, as such. But my understanding is that Eclipse needs to build the projects for various IDE features to work; for instance completion and syntax checking.

Perhaps I should be thinking about using a different IDE ...

#3

This got worse for me last week and for a few hours I was unable to build at all within Eclipse. However, I've found a temporary workaround that allows me to build.

The default Eclipse compiler settings give something like 30K to 40K warnings. If change the settings to change all conditions that are currently "Warning" to "Ignore", the build completes without running out of memory.

#4

I have a problem too running on 64bit.

In all/lib/jnode.xml the default memoryMaximumSize of 768MB is not enough. I have it localy set to 1524 to build JNode.

#5

Status:active» fixed

Levente's extraction of the JDK classes into a classlib has resolved this issue. Marking as fixed.

#7

Status:fixed» closed

Closed manually