permaculture playing cards*
The moose likes Java in General and the fly likes Size of class file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Size of class file" Watch "Size of class file" New topic
Author

Size of class file

punna Kumar
Ranch Hand

Joined: Feb 28, 2005
Posts: 80
Hi,
is there any restriction to size of class file in java.i am faceing the out of memory issues in my WSAD when the size of class file is incresed.


any one have a idea?


ravi
Shaan Shar
Ranch Hand

Joined: Dec 27, 2005
Posts: 1249

Beta Punna Kumar

I cann't Understand what you really want to know it will be better for you to sepecify the code and exact error so that we can analyze and clear your understanding.



The Best way to predict your future is to create it - Every great individual common man
punna Kumar
Ranch Hand

Joined: Feb 28, 2005
Posts: 80
Thanks for your replay

I am using WSAd 5.1.2 for deveoping environment. if my code exceded the 5000 lines of code the out of memory is coming.

Ravi.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Ah... what are you doing that requires that much code in one class? That sounds like a class that really needs to be refactored into smaller classes. How do you go about maintaining somethign that size? Is it all methods? Huge String literals maybe? What?


"I'm not back." - Bill Harding, Twister
punna Kumar
Ranch Hand

Joined: Feb 28, 2005
Posts: 80
yeah your right,
it's bean class seter and getter methods.these all methods are used throught of my project. to avoid the duplicate the same methods in different beans we create this class. it's like a base class.


Ravi
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18553
    
  40

Related to the original question, but along a different track...

Eclipse is just a Java application, have you tried starting it with a bigger heap?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Also, when exactly does the memory problem occur? When compiling? When you run? Does it happen as soon as the class loads, or sometime later? For example, is it possible for you to create at least one instance of this class before the error occurs?
punna Kumar
Ranch Hand

Joined: Feb 28, 2005
Posts: 80
thanks for replay

i work around to set the java heap size set to -Xmx512m -Xms20m. due to this one my entire system will become very slow. i mean i unable to open other application.

i would like to know how quick i can slove the problem. is any other way to find out in WSAD how many instances are getting created for this class.

Ravi.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

I think it is extremely unlikely that you could create a class that is so large that it instantly uses up a multi-megabyte heap. It is far more likely that your question "how many instances are getting created for this class" is the correct one. And the other question is "why are they being stored permanently".

As far as I know, WSAD includes profiling. I have never used it, though, so I can't tell you anything more about it. I'm sure the WSAD help files have a lot about profiling.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Size of class file
 
Similar Threads
doPost()
Large JSP Files
file length method not working!!!!!!
Class size optimization
About Try-Catch