Swap issue also on Update 4 ?

A forum for general AmigaOS 4.x support questions that are not platform-specific

Swap issue also on Update 4 ?

Postby samo79 » Sat Jan 07, 2012 12:00 pm

I know that this argument was already covered in many places however i test again the swap functionality copying some files on RAM disk (but now using Update 4) but after i exceed the amount of my physical memory (that is 1 GB) all i get is the usual freeze

My system is:

SamFlex 800 Mhz
1 GB RAM
AmigaOS 4.1 Update 4 (Kernel 53.25)

And this is my swap settings:

http://imageshack.us/photo/my-images/805/swap.png/
User avatar
samo79
 
Posts: 395
Joined: Fri Jun 17, 2011 11:13 pm
Location: Italy

Re: Swap issue also on Update 4 ?

Postby Hypex » Sat Jan 07, 2012 12:23 pm

I also get a freeze when my VRAM gets too low. The system stutters then mouse freeze. Can reboot, no crashlog.

Sometimes a USB mouse/KB and bring it back. Sorry tihs slightly off topic.
User avatar
Hypex
Beta Tester
Beta Tester
 
Posts: 326
Joined: Mon Dec 20, 2010 2:23 pm
Location: Vic. Australia.

Re: Swap issue also on Update 4 ?

Postby ssolie » Sat Jan 07, 2012 5:43 pm

You are likely locking all memory. When this happens the system will freeze and this is normal for the swapper and always has been that way. There is no "fix" because there is nothing he OS can do when you force this situation. Apps should avoid using shared memory because it is locked and eats up available address space.
AmigaOS Development Team Lead
Be authentic. Get AmigaOS.
User avatar
ssolie
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 895
Joined: Mon Dec 20, 2010 8:51 pm
Location: Canada

Re: Swap issue also on Update 4 ?

Postby kas1e » Sat Jan 07, 2012 7:35 pm

Imho, system never should freezes, and better to have ugly workorounds (like even linux do, or kind), in compare with freezes. System should handle all the problematic parts, and when its need it, some how inform user about, or do something tasty, which in end will not results as freeze. What the reassons to call swapping as swapping, if it just not swapping but freezing ? Sure , apps should do or not do something, but if still they do, OS by itself should handle problematic moments and workoround them.

And, to add, as i know on update2 swapping still works somehow, but start to freeze in update3 and in update4.
kas1e
Beta Tester
Beta Tester
 
Posts: 369
Joined: Sat Jun 18, 2011 7:56 am

Re: Swap issue also on Update 4 ?

Postby samo79 » Sat Jan 07, 2012 7:38 pm

ssolie wrote:You are likely locking all memory. When this happens the system will freeze and this is normal for the swapper and always has been that way. There is no "fix" because there is nothing he OS can do when you force this situation. Apps should avoid using shared memory because it is locked and eats up available address space.


Hi Steven thanks for reply :-)
Yep of course this is a force situation for sure (it serve me for this test only) but i have a question at this point: where is the difference between fill the memory copying files in RAM and using the OS "for real" finishing the phisical memory with many apps opened ?

I think the result might be the same as memory are used exact the same, or not ?

I didn't try to open many apps at the same time to fill my entire mem (for a real test can say!) just because i have 1 GB installed (a lot of memory in general for AmigaOS) but i can do without any freeze eventually ?

Also why all that freeze ? how about adding and error message and just skip in that case ?
Isn't better ?

@Hypex
No problem ;)
User avatar
samo79
 
Posts: 395
Joined: Fri Jun 17, 2011 11:13 pm
Location: Italy

Re: Swap issue also on Update 4 ?

Postby Raziel » Sun Jan 08, 2012 9:40 am

@ssolie

Just a little question.

Would it also be a "forced" situation (or maybe simply a bug with the lha program) if i pack a lha with files which size's exceeding my RAM (512MB)?

I get a slowdown from lha first (Can be seen by the packing algorythm counting the bytes in shell - slower) and after a few more MB's into the SWAP freezing?

Also (but thats slightly OT) the game i referred to in my Bug report (Aquaria) is still freezing, not THAT bad as with upd3, but still (can be a bug in the game though, that's why i said OT)

Hmm, i need to test UnArc with huge .lha's...
If slaughterhouses had glass walls, everyone would be a vegetarian ~ Paul McCartney
--
AmigaOS4 doesn't have bugs -- it just develops random features ;-)
User avatar
Raziel
 
Posts: 477
Joined: Sat Jun 18, 2011 4:00 pm
Location: A haunted Castle somewhere in the Bavarian Mountains

Re: Swap issue also on Update 4 ?

Postby ZeroG » Sun Jan 08, 2012 1:52 pm

ssolie wrote:You are likely locking all memory. When this happens the system will freeze and this is normal for the swapper and always has been that way. There is no "fix" because there is nothing he OS can do when you force this situation. Apps should avoid using shared memory because it is locked and eats up available address space.


Maybe i miss something here, but the memory used by ram-handler to store files should always be swapable, or?
User avatar
ZeroG
 
Posts: 78
Joined: Sat Jun 18, 2011 11:31 am
Location: Germany

Re: Swap issue also on Update 4 ?

Postby Deniil » Sun Jan 08, 2012 11:33 pm

ssolie wrote:You are likely locking all memory. When this happens the system will freeze and this is normal for the swapper and always has been that way. There is no "fix" because there is nothing he OS can do when you force this situation. Apps should avoid using shared memory because it is locked and eats up available address space.


That's silly. When the system cannot allocate memory it should return NULL, and that's it. AmigaOS has always worked that way and all Amiga programs can handle it (except a few bad ports maybe).
Freeze!? WTF is that..?!

Just because AmigaOS suddenly has swapping, then returning NULL is not an option, but freezing the OS is the "better" way to do it, eh? :-? Come on! You can do better, I know it :-)

Btw. Why does RAM disk use shared memory, since filling it up causes this "forced" situation?
Deniil
 
Posts: 97
Joined: Mon Jul 11, 2011 6:59 pm

Re: Swap issue also on Update 4 ?

Postby samo79 » Fri Jan 13, 2012 10:39 pm

@denill

Just found this reply from Thomas Frieden and seems (maybe) really usefull to understand our problem:

Why MEMF_VIRTUAL ? Have you actually checked the autodocs ? If yes, where does it even mention MEMF_VIRTUAL ?

MEMF_VIRTUAL is NOT for memory allocations. Use either MEMF_SHARED or MEMF_PRIVATE. Using MEMF_VIRTUAL will make use of the default memory type MEMF_SHARED.

And there's your problem. MEMF_SHARED allocates memory that is automatically locked in memory. This can NOT be paged out. In other words, you basically fill the whole memory and lock it in place. Yes, this will lead to a lockup at one point because there simply is no way to page anything in or out if all memory ends up being locked. Linux "solves" this by killing off random processes and re-using their memory. AmigaOS does not have memory ownership, so there is NOTHING that can be done once this situation arises.


viewtopic.php?f=14&t=666#p8185

So in short (for what i can understand as plain user with very little tech knowledge) our problem is that RAM disk use that shared memory (MEMF_SHARED = shared memory ?) so it will no swappable at all and it will freeze instead when we try to fill the RAM disk directory ...

This until they add such "killing off random process" (Linux style)

What i don't understand is why RAM disk use this kind of shared memory if it will prevent us to swap from RAM, i think RAM should be exactly the right place when the system should swap normally, conversely i really don't understand where OS4 can swap ... infact i don't understand how all that VM thing work under AmigaOS4 :roll:

Pardon if i wrote crap, i just try to understand !
User avatar
samo79
 
Posts: 395
Joined: Fri Jun 17, 2011 11:13 pm
Location: Italy

Re: Swap issue also on Update 4 ?

Postby tonyw » Fri Jan 13, 2012 11:58 pm

Yes, one of the problems is the type of storage that RAM uses (MEMF_SHARED). If it were MEMF_PRIVATE, then the memory occupied by the RAM Disk could be swapped out to allow other data into RAM. But that means a quantum change in the way that RAM has been understood in the past - for instance, what happens if you load a program into RAM, execute it from RAM, and the first thing it does is to fill the RAM disk with big photos? Can the program itself be swapped out? What happens if it is? How can you prevent it being swapped out? The program is only another file, after all.

Unfortunately, RAM's storage is only part of it. I've tried changing RAM to allocate only MEMF_PRIVATE, and it is not a cure-all, there are other effects still there, that may not be caused by the ram-handler.

As I said, a simple change won't fix the problem.
We're working on it.
cheers
tony
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 710
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Next

Return to General AmigaOS

Who is online

Users browsing this forum: No registered users and 1 guest