Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

Page file and memory in Java

Thread view: 
Dlugi - 08 Jun 2007 16:51 GMT
Hi,

I have to allocate a large amount of memory in java appl., but I noticed
that operating system (windows xp) move large parts of heap from ram to
page file.
Does anybody know how can I avoid paging in java?

Thanks in advance
Steve W. Jackson - 08 Jun 2007 17:46 GMT
> Hi,
>
[quoted text clipped - 4 lines]
>
> Thanks in advance

Java doesn't do the paging; the underlying OS handles that.
Signature

Steve W. Jackson
Montgomery, Alabama

Arne Vajhøj - 09 Jun 2007 01:11 GMT
> I have to allocate a large amount of memory in java appl., but I noticed
> that operating system (windows xp) move large parts of heap from ram to
> page file.
> Does anybody know how can I avoid paging in java?

Java allocates virtual memory from the OS. The OS back
that virtual memory with physical memory and page file.

It is not a Java problem. It is an operating system
problem.

I don't think WinXP really limits a processes RAM usage, so
maybe there are two many and too big processes for the
available RAM ?

Arne
Dlugi - 09 Jun 2007 13:50 GMT
> Java allocates virtual memory from the OS. The OS back
> that virtual memory with physical memory and page file.
[quoted text clipped - 7 lines]
>
> Arne

I know, but I hoped that there was some 'magic' option of JVM which
forbids WinXP to move ram to page file.
Lew - 09 Jun 2007 13:51 GMT
> I know, but I hoped that there was some 'magic' option of JVM which
> forbids WinXP to move ram [sic] to page file.

There is - run it in Linux or add more RAM or stop running the other programs
on the same box.

OK, only the first option actually forbids Win XP to swap the JVM's RAM.  The
others can help, though.

Signature

Lew

David Gourley - 11 Jun 2007 22:12 GMT
>> I know, but I hoped that there was some 'magic' option of JVM which
>> forbids WinXP to move ram [sic] to page file.
[quoted text clipped - 4 lines]
> OK, only the first option actually forbids Win XP to swap the JVM's
> RAM.  The others can help, though.

I think there is some magic you can do - but note that it will not be
portable to other OSs.

Take a look at the KeepResident plugin for eclipse:

http://suif.stanford.edu/pub/keepresident/

This shows you how to do it.

Windows is over-zealous about paging out because it thinks its better to
keep memory for disk buffer cache than for your large (in Windows terms)
badly behaved JVM.......

Dave
Jim Garrison - 11 Jun 2007 22:21 GMT
>>> I know, but I hoped that there was some 'magic' option of JVM which
>>> forbids WinXP to move ram [sic] to page file.
[quoted text clipped - 19 lines]
>
> Dave

If you have sufficient physical memory (2GB or more) you could
just disable paging at the OS level.  I routinely run my 2GB
desktop and laptop with paging turned off (paging file size == 0).
Ed Jensen - 12 Jun 2007 21:02 GMT
> If you have sufficient physical memory (2GB or more) you could
> just disable paging at the OS level.  I routinely run my 2GB
> desktop and laptop with paging turned off (paging file size == 0).

I do the same thing.

Even though I never exhaust physical RAM, I've noticed that disabling
the page file on Windows results in a huge performance increase.

Linux doesn't seem to have this problem.
Jim Garrison - 13 Jun 2007 15:07 GMT
>> If you have sufficient physical memory (2GB or more) you could
>> just disable paging at the OS level.  I routinely run my 2GB
[quoted text clipped - 6 lines]
>
> Linux doesn't seem to have this problem.

As someone else said, Windows is very aggressive about swapping
out application code in favor of I/O buffers, while Linux
uses a more sane approach.  In linux you can actually control
the 'swappiness' of the system as a whole (but I can't remember
the parameter right now).


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.