• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

64-bit processing and 8 GB of RAM

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there, I'm about to start working on a G5 that has a 64-bit processor and 8 GB or RAM. What should I be aware of from the start about how to program Java in this environment? In particular, are there settings in the JVM I need to modify? Do i do anything different with my code? For example, if I need a data structure that is 6GB do I address it like normal? I'm trying to track down the "Mac OS X for Java Geeks" book, does it contain any material on this topic?

Cheers,
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the current Mac JVM is 32-bit, and thus still has an upper limit around 2GB. If I had to guess, I'd guess that the 1.5 JVM will be 64-bit.

To judge from what I've heard of the Solaris 64-bit port, all you'll need to do is set some flags on the command line when starting the JVM. One to enable the 64-bit JVM, another to set the maximum memory pool to a sufficiently high value.

I suppose there could be some issues with the Collections classes, though; for instance, Set.size returns an int.

I skimmed through the Iverson book you're referring to a while ago. As I recall, there's nothing on 64-bit processing, but there's not really much to say right now. If you're having problems getting a hard-copy of the book, you might try Safari, assuming you don't mind looking at it online.
 
Emilio Gagliardi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Loren!
Thax for that.
What does Safari mean in the context you provided it? I don't mind reading anything online, I'm just not sure what you are refering to there. :/

Also, we are talking mac here, so we don't have access to 1.5 and so I should continue programming as though nothing exceeds the largest integer value? Last question, the 2 GB limit, by what you've said I am restricted to 2^31-1 objects to a collection, whose total memory may exceeed 2 GB. So, I could create 1 variable that requires 6GB worth of memory and java will be able to manage the memory?

Cheers,
 
Loren Rosen
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Emilio Gagliardi:

What does Safari mean in the context you provided it? I don't mind reading anything online, I'm just not sure what you are refering to there.


Forgot that Safari is an overloaded term in this context. Here I'm referring to the on-line subscription service that O'Reilly runs that lets you read most of their books (and quite a number from other publishers) online. It's at safari.oreilly.com. (Though you can only read a limited number of books at the same time.)



Also, we are talking mac here, so we don't have access to 1.5 and so I should continue programming as though nothing exceeds the largest integer value? Last question, the 2 GB limit, by what you've said I am restricted to 2^31-1 objects to a collection, whose total memory may exceeed 2 GB. So, I could create 1 variable that requires 6GB worth of memory and java will be able to manage the memory?



There will definitely be restrictions on the total of all the memory you use, so unless you have a 64-bit savvy JVM I wouldn't expect to be able to allocate more than 2^31 or so objects, or use more than 2GB memory. In practice you'll run out of memory first, so the limit on the number of objects is purely theoretical.

Note that in Java a "variable" is ultimately a composite of other objects and so ultimately a bunch of ints, arrays, etc. So really the only way to allocate a bunch of memory is via an array. And arrays are still limited to int indexes.

In the 64-bit savvy world, you could indeed allocate more than 2^31 objects but there could be hidden issues with the current Collections packages. Also, anecdotally I've heard that garbage collection can get slow when you allocate so many objects.
 
Emilio Gagliardi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Loren, thank you very much for your advice and support. I will check out safari and hold my breath for 1.5

cheers,
 
No more fooling around. Read this tiny ad:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!