Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

if Java has garbage collection, then why

 
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
applications written in JAVA, like Borland's JBuilder, is always growing in time by the memory occupied untill completely stuck.
There is no way out but periodically restart JBuilder
What are they irreversably accumulate?
 
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My java applications don't do this. :-) I've seen some applications that grow big in memory, but they always level off to some working set consistant with the supplier's platform recommendation.
I'm not using JBuilder, so I'm not sure what you are describing in this case.
Is it that the total amount of memory that the operating system allocates to the Java virtual machine running this Java application keep growing, eventually causing thrashing at the operating system level, typically slowing down everything running on the system.
The amount of memory allocate to a JVM can usually be specified as a start-up option for the JVM. JVM's don't necessarily garbage collect as long as they are well below this limit. Perhaps the limit used to run your application is too high compared to the amount of physical memory on your machine. If you set it lower, you increas the risk that you application will run out of memory. But but may be set very high to allow your program to handle much larger jobs than you typically need.
(I wonder if specifying "incremental garbage collection" might help with this.)
It could also be the case that the program has a memory leak, failing to drop references to objects no longer needed. But I doubt that's the case for JBuilder.
 
Ranch Hand
Posts: 1246
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tried the System.gc()???
 
John Dale
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was talking talking about running applications already written, not ones we can modify. If the program has options to cause it to manage memory more tightly, perhaps using System.gc(), that's great, but otherwise, the Java environment runtime options may be the only controls you have.
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hei, FEI & John,
I refer to IDE JBuilder of different versions (Professional, Enterprise, Personal, vers.4, vers.3, vers.5). It is the same both Windows and in Linux (Mandrake, Debian of differrent versions). I do not mess with the code of it. This is the problem experienced by all my colleagues.
The JBuilder process/application just occupies more and more space till OS becomes very slow.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just a point of interest. I do not believe that JBuilder was written in Java. If it has a memory problem you should probably ask the vendor for solutions.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm pretty sure that most of JBuilder is in Java. In the Windows version there is a .exe file and several .dlls, but they're not very big - there's a 16-meg jbuilder.jar file in the lib directory that looks like it does most of the work. Moreover, JBuilder looks like a swing application. At least, it does if you go to Tools -> IDE Options -> Browser -> Look and select "Metal". For me this looks like a dead giveaway that they're using the javax.swing.LookAndFeel classes to control appearance. I suppose it's possible that some other platform now supports the notion of look and feel, but I doubt it.
For the original question - I don't know. I use JBuilder 5 Pro all the time, and don't notice any problems. I've always had at least 256 Mb in my system though - are you running with notably less than that? Or perhaps you're working with features or classes that I don't - I rarely create GUI's, for example. Do you close tabs and windows that you don't need? That's the main thing I can think of that builds up over time if you're not careful.
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
RAM: 128 MB and more (my colleagues have up to 256 MB).
I deal with a Swing, JDBC (on remote server), etc. and a lot of deprecated classes
But unloading any files or applications does not help. It is JBuilder...
Anyway I recalled from after your reply that there platform-dependent, heavey-weight, peer, poor Java-native-classes matches, bugs, etc. ....
About what I really wanted at the morning go to to Swing/AWT forum but did not have time.
I may test that question here.
My book on AWT has phrase:

I do not quite get why should we have window and cannot place directly. I am rereading dozens of times some available to me phrases about heavy-/lightweights, peers.... May anybody give me good links on the mess?
 
Author
Posts: 6055
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JBuilder is a Java application. It may contain a little bit of C/C++, but it's mostly Java.
It is possible to get memory leaks in Java. Basically, if you keep pointers to objects around, you never GC those objects and they build up over time.
I haven't heard of any memory leaks in JBuilder. You can try Borland's site, as well as the JBuilder newsgroups.
--Mark
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark,
thanks. I'll stick with this portal because I am afraid of foundering me down ...
 
Guennadiy VANIN
Ranch Hand
Posts: 898
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,Jim,
I am really stupid explaing boringly what is really possible to see...
My application, at least, external fa´┐Żade is at http://www.poe.min-economia.pt
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mark Herschberg:
It is possible to get memory leaks in Java. Basically, if you keep pointers to objects around,... --Mark


Careful about using the word pointers in JAVA. You could create quite a debate. AT least I did.

------------------
Happy Coding,
Gregg Bolinger
 
Mark Herschberg
Author
Posts: 6055
8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good point Gregg. Change "pointers" to "references" :-)
--Mark
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, the company I work for has had this problem with JBuilder too... it's not because JBuilder is written in Java, it's because any time you access ( i.e. open, compile, run, etc. ) a class file, it (or a reference to it or something) stays in memory... so if you are on a really big project that has alot of classes, alot of memory gets used up keeping track of all the classes. The worst is when you do a system re-compile... all the classes in the whole project are accessed.

I think that Borland (or Inprise or whoever owns JBuilder now... ) could probably fix this by un-cacheing classes completely, or adding some scheme to unload classes after a while, but it would probably slow down other aspects of the system, though it would be nice to at least choose to cache classes or not, if you were having this problem... in fact, maybe in newer versions of JBuilder you can... we use v.4, so I can't speak about newer versions.

-Nate
 
reply
    Bookmark Topic Watch Topic
  • New Topic