.swapfile

Hi,

In qnx6 i’d like to remove the .swapfile, how do i go about doing that.
It is currently taking 128MB of my 512MB flash card.

Joel

“Joel D Weingarten” <jweingar@umich.edu> wrote in message
news:3C58200A.6B69E782@umich.edu

Hi,

In qnx6 i’d like to remove the .swapfile, how do i go about doing that.

Delete it :wink:

Also remove the swapctl command from one of the file
in /etc/rc.d/* (that’s from memory don’t recall the exact filename)
otherwise it will get created again.

Some stuff (gcc) will not work without it though

It is currently taking 128MB of my 512MB flash card.

Joel

Mario Charest wrote:

“Joel D Weingarten” <> jweingar@umich.edu> > wrote in message
news:> 3C58200A.6B69E782@umich.edu> …
Hi,

In qnx6 i’d like to remove the .swapfile, how do i go about doing that.

Delete it > :wink:

Also remove the swapctl command from one of the file
in /etc/rc.d/* (that’s from memory don’t recall the exact filename)
otherwise it will get created again.

Some stuff (gcc) will not work without it though

It is currently taking 128MB of my 512MB flash card.

Joel

Having already tried that it does get rid of the .swapfile but only in
appearance. i.e the .swapfile is no longer there but the space if takes up
is not freed and given back to the flash disk when i do “df -k .” . Any
help would be appreciated.

thank,

Joel

Some stuff (gcc) will not work without it though

Does QNX6 use swaps anyway?

My laptop has 32M mem and installer makes 64M /.swapfile,
but gcc fails nevertheless when physical 32M is exausted.
swapctl output doesn’t show the swapfile is ever used.

Given QNX is realtime OS, not supporting swapfiles are reasonable enough tho.

kabe

Joel D Weingarten <jweingar@umich.edu> wrote in
news:3C5864A9.3908111D@umich.edu:

Having already tried that it does get rid of the .swapfile but only in
appearance. i.e the .swapfile is no longer there but the space if
takes up is not freed and given back to the flash disk when i do “df -k
.” . Any help would be appreciated.

Did you remove the swapctl reference from the startup scripts? What does
running swapctl report?

\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

<kabe@sra-tohoku.co.jp> wrote in news:a3a0bk$oo$1@inn.qnx.com:

Does QNX6 use swaps anyway?

My laptop has 32M mem and installer makes 64M /.swapfile,
but gcc fails nevertheless when physical 32M is exausted.
swapctl output doesn’t show the swapfile is ever used.

RTP will use the swap for gcc, since it gets piggish when building.

Given QNX is realtime OS, not supporting swapfiles are reasonable
enough tho. –

Neutrino (embedded) should not have a swapfile, but I suppose if you really
wanted one you could - I have seen stranger things happen :slight_smile:

\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

Hi Adam

I just wanted to point out that you made a distintion between RTP and Nto.
I thought that QSSL was now trying to represent them as the same thing.

So, let me get this straight. Nto is the core OS and utilities. And RTP is
Nto and Photon bundeled together? At least that’s what it once was.


Bill Caroselli – 1(626) 824-7983
Q-TPS Consulting
QTPS@EarthLink.net


“Adam Mallory” <amallory@qnx.com> wrote in message
news:Xns91A759219C468amalloryqnxcom@209.226.137.4

kabe@sra-tohoku.co.jp> > wrote in news:a3a0bk$oo$> 1@inn.qnx.com> :

Does QNX6 use swaps anyway?

My laptop has 32M mem and installer makes 64M /.swapfile,
but gcc fails nevertheless when physical 32M is exausted.
swapctl output doesn’t show the swapfile is ever used.

RTP will use the swap for gcc, since it gets piggish when building.

Given QNX is realtime OS, not supporting swapfiles are reasonable
enough tho. –

Neutrino (embedded) should not have a swapfile, but I suppose if you
really
wanted one you could - I have seen stranger things happen > :slight_smile:

\

Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net

Hi,

The weird thing is that swapctl says the file size is 0 and doesnt exist…
so i create a new one 64M (swapctl agrees) and then delete it and again
swapctl says file size 0 but know df -k . says i’ve eaten up another 64M of
my flash card, so i’m quickly running out of space (128+64 are wasted). As
I would not like to reinstall everything i am perplexed as to how to regain
that space.

thanks,

Joel

Adam Mallory wrote:

Joel D Weingarten <> jweingar@umich.edu> > wrote in
news:> 3C5864A9.3908111D@umich.edu> :

Having already tried that it does get rid of the .swapfile but only in
appearance. i.e the .swapfile is no longer there but the space if
takes up is not freed and given back to the flash disk when i do “df -k
.” . Any help would be appreciated.

Did you remove the swapctl reference from the startup scripts? What does
running swapctl report?


Cheers,
Adam

QNX Software Systems Ltd.
[ > amallory@qnx.com > ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> pschon@baste.magibox.net

Joel D Weingarten <jweingar@umich.edu> wrote:

The weird thing is that swapctl says the file size is 0 and doesnt exist…
so i create a new one 64M (swapctl agrees) and then delete it and again
swapctl says file size 0 but know df -k . says i’ve eaten up another 64M of
my flash card, so i’m quickly running out of space (128+64 are wasted). As
I would not like to reinstall everything i am perplexed as to how to regain
that space.

Is it a fs-qnx4 filesystem on the flash card (ie ATA/Flash)? If so, the
disk space used by a file is not reclaimed until both the link count and
the open count is 0. If Proc continues to hold open the .swapfile (and
swapctl doesn’t trigger it to close it) then the space will not be
reclaimed until Proc terminates, and since devb is gone by then, it is
not going to happen! You should be able to reclaim such space by
running “chkfsys” against the filesystem, which will detect the orphaned
disk blocks …

“Bill Caroselli” <qtps@earthlink.net> wrote in
news:a3bpa9$ajs$1@inn.qnx.com:

I just wanted to point out that you made a distintion between RTP and
Nto. I thought that QSSL was now trying to represent them as the same
thing.

In terms of packaging/brand that may be. But since I’m more of a geek,
I’ll prefer to make a distinction between the developement host OS, and the
target OS.

So, let me get this straight. Nto is the core OS and utilities. And
RTP is Nto and Photon bundeled together? At least that’s what it once
was.

Neutrino (to me, as part of the OS group) is just the core OS, proc and
perhaps some supporting programs for taste :slight_smile:. RTP is a name given to the
host developement environment, which includes the heavy tools like
compilers, linkers, editors (vi being the only true editor ) etc that
don’t usually appear on a target platform (not to say it can’t :slight_smile: ).

If you prefer I can refer to it all as RTP.

-Adam

Hi Kabe and other gentlemen,
I’m not sure you’ve seen the right swapctl statistic. I tried the next experiment:

  1. I launch program which eat all memory in system except small piece. This piece is important
    because without it you’ll not able to do anything more. You’ll get shell’s error: Can’t fork, try
    again. Is not it strange for system with swapfile: gcc use swapfile, but shell does not.
  2. I launch gcc to compile small project. It eats rest of memory and continue work. I was unable to
    launch swapctl to see statistic while gcc was working (see point 1). But when gcc is finished I did
    not see any usage of swapfile in statistic. I don’t believe gcc was working in that small piece of
    memory. Maybe, I don’t understand some basic principles. It was just for fun experiment :wink: I
    reported it somewhere on newsgroups. Thanks for reading.
    Best regards,
    Eduard.


    kabe@sra-tohoku.co.jp wrote in article <a3a0bk$oo$1@inn.qnx.com>…

Some stuff (gcc) will not work without it though

Does QNX6 use swaps anyway?

My laptop has 32M mem and installer makes 64M /.swapfile,
but gcc fails nevertheless when physical 32M is exausted.
swapctl output doesn’t show the swapfile is ever used.

Given QNX is realtime OS, not supporting swapfiles are reasonable enough tho.

kabe

ed1k <ed1k@yahoo.com> wrote in article 01c1ab0c$20f0e520$106fa8c0@ED1K

again. Is not it strange for system with swapfile: gcc use swapfile, but shell does not.
Sorry, I reread this sentence and understand, I made a blooper… Perhaps, shell must not use

swapfile for itself. But application for eating most of memory in my experiment, it was
helpviewer… or voyager… or both, sorry I don’t remember. They are very important applications
and can not be placed in swap… So, correct question is why only gcc can use swap? Or some other
applications also enable the swap usage, but I don’t know them? Can QNX RTP 6.X to move such
“desktop app” to swapfile in order to free some piece of phisicaly memory for really actual
application (for example for shell which is trying to do something useful, e.g. kill)
-keys were pressed by Eduard.

I’m not sure you’ve seen the right swapctl statistic. I tried the next experiment:
[interesting swap experiment deleted]

My usage shows it will fail:
*) prepare 128MB swapfile, confirm with “swapctl -s” (reboot to be sure)
*) launch Xphoton, voyager and kterm
this will get around 4MB free mem
*) Compile devc-con from Character DDK.
cc: spawn of /usr/lib/gcc-lib/ntox86/2.95.2/cc1 failed: Not enough memory

I don’t quite get why gcc ever uses swap (does gcc have special logic
for malloc()?), but the above error suggests fork() is failing.

You can’t get much if OS doesn’t automigrate to swap, so my conclusion
was Nto doesn’t use swap (at least transparently).

kabe

kabe@sra-tohoku.co.jp wrote:

Some stuff (gcc) will not work without it though

Does QNX6 use swaps anyway?

My laptop has 32M mem and installer makes 64M /.swapfile,
but gcc fails nevertheless when physical 32M is exausted.
swapctl output doesn’t show the swapfile is ever used.

If gcc tries to grab a chunk of memory that is bigger then the physical memory
free at the time of the allocation it will get a failure. The swap stuff
is a big kludge that was added in to try to make the gcc toolchain a little
happier. But, it does not always keep it happy - as you have seen. :slight_smile:

chris

\

Chris McKillop <cdm@qnx.com> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/

John Garvey wrote:

Joel D Weingarten <> jweingar@umich.edu> > wrote:
The weird thing is that swapctl says the file size is 0 and doesnt exist…
so i create a new one 64M (swapctl agrees) and then delete it and again
swapctl says file size 0 but know df -k . says i’ve eaten up another 64M of
my flash card, so i’m quickly running out of space (128+64 are wasted). As
I would not like to reinstall everything i am perplexed as to how to regain
that space.

Is it a fs-qnx4 filesystem on the flash card (ie ATA/Flash)? If so, the
disk space used by a file is not reclaimed until both the link count and
the open count is 0. If Proc continues to hold open the .swapfile (and
swapctl doesn’t trigger it to close it) then the space will not be
reclaimed until Proc terminates, and since devb is gone by then, it is
not going to happen! You should be able to reclaim such space by
running “chkfsys” against the filesystem, which will detect the orphaned
disk blocks …

Thanks, chkfsys did the trick… now if only i could remove remove the doc
files in /pkgs/base/qnx/os/usr/ doc-2.1.2 :slight_smile: