This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
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 Soft Skills this week in the Jobs Discussion 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
 
 
subject: Max size of java class