Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Page file and memory in Java

1 view
Skip to first unread message

Dlugi

unread,
Jun 8, 2007, 11:51:43 AM6/8/07
to
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

unread,
Jun 8, 2007, 12:46:38 PM6/8/07
to
In article <f4btsc$jpq$1...@news.task.gda.pl>, Dlugi <pra...@jak.email>
wrote:

Java doesn't do the paging; the underlying OS handles that.
--
Steve W. Jackson
Montgomery, Alabama

Arne Vajhøj

unread,
Jun 8, 2007, 8:11:13 PM6/8/07
to

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

unread,
Jun 9, 2007, 8:50:28 AM6/9/07
to
> 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
>
I know, but I hoped that there was some 'magic' option of JVM which
forbids WinXP to move ram to page file.

Lew

unread,
Jun 9, 2007, 8:51:35 AM6/9/07
to
Dlugi wrote:
> 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.

--
Lew

David Gourley

unread,
Jun 11, 2007, 5:12:07 PM6/11/07
to

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

unread,
Jun 11, 2007, 5:21:22 PM6/11/07
to

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

unread,
Jun 12, 2007, 4:02:15 PM6/12/07
to
Jim Garrison <j...@athensgroup.com> wrote:
> 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

unread,
Jun 13, 2007, 10:07:22 AM6/13/07
to

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).

0 new messages