wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Max size of java class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Max size of java class" Watch "Max size of java class" New topic
Author

Max size of java class

Paul Doherty
Greenhorn

Joined: Jan 11, 2001
Posts: 11
What is the maximum size(in kilobytes) a java class can be? Indeed can a class be any size?
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
In theory there is no limit, however a particular machine may throw an OutOfMemoryError if there is not enough memory to completely load the class.
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
Well there are actually practical limits on a variety of entities, like size of identifier names, numbers of methods, limits on parameter lists, etc; So there are upper limits on how big a class file can be.
Details here:
http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#88659
(Thanks to zakaria haque for the link)
[ March 12, 2002: Message edited by: Rob Ross ]

Rob
SCJP 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Max size of java class