Click here to Skip to main content
15,922,512 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: 8GB no longer enough Pin
phil.o25-Aug-19 22:23
professionalphil.o25-Aug-19 22:23 
GeneralRe: 8GB no longer enough Pin
Dan Neely26-Aug-19 3:44
Dan Neely26-Aug-19 3:44 
GeneralRe: 8GB no longer enough Pin
kalberts26-Aug-19 0:29
kalberts26-Aug-19 0:29 
GeneralRe: 8GB no longer enough Pin
raddevus26-Aug-19 1:53
mvaraddevus26-Aug-19 1:53 
GeneralRe: 8GB no longer enough Pin
Dan Neely26-Aug-19 3:51
Dan Neely26-Aug-19 3:51 
GeneralRe: 8GB no longer enough Pin
kalberts26-Aug-19 7:00
kalberts26-Aug-19 7:00 
GeneralRe: 8GB no longer enough Pin
objectvill27-Aug-19 1:54
objectvill27-Aug-19 1:54 
GeneralRe: 8GB no longer enough Pin
kalberts27-Aug-19 5:07
kalberts27-Aug-19 5:07 
You may be making 30 million memory accesses per second to some memory page - that is one per 80-100 clock cycles - but those are essentially to pages already in RAM. (Actually, even 30 million sounds high: The great majority of memory references hit the cache, and doesn't even go out to RAM.) If you really reference every corner of 120 GByte (30 million 4ki pages) every minute, then you are working with tasks such as weather forecasts or FEM. Not general software development.

If you generated one page fault every 33 microsecond, there would be now way for the disk to serve the requests. Not even a flash disk can deliver 120 Gbytes/sec (30 million * 4 ki) from the paging disk, so within a brief moment, the threads not blocked on a page fault would have the CPU to themselves and run at top speed Smile | :) ... and that claimed 30 million accesses a second would drop to almost zero. In other words: I do not trust your figures at all.

objectvill wrote:
I think that not even windows 10 can boot without paging.
At boot time, paging is certainly not activated! It needs an OS in place to set up page tables properly; all entries are empty. I don't know how far you will stretch the "boot" time; if it goes all the way up to the login dialog, the OS has certainly done the initialization. You can tell Windows not to use a paging file; then you will never page anythng out to disk. I assume that read-only segments (e.g. code) are still read on demand from the .exe/.dll - the "memory mapped file" mechanism uses the paging tables, and code access is very close to the same thing. So page tables are used, the hardware is there and difficult to overlook. You will have that logical-to-physical mapping in any case, whether you have a page file or not. You may call it "paging" because page tables are used; I do not, when the main purpose is to allow different applications to run in overlapping virtual address spaces which are mapped to distinct physical spaces, not to provide more virtual than physical memory.


As I said before: Take a look at actual physical disk activity. In the old days, each disk had a LED indicating physical activty; today they do not, but the SATA controller may have a head for connecting a LED indicating activity on any of the disks controlled by it. The Resource Monitor can tell you for how large percentage of time the driver is waiting for the disk, but not even that will necessarily indicate physical access: All (magnetic) disks today have fairly large RAM caches, so data may be served at RAM speeds.

You can add up the size of JVM, .net, emulator, editor..., and the sum may come to 120 GByte (i.e. 30 million pages), but they do not "have in memory all the methods and variables and modules". They are out on disk. When you are, say, prompted for parameters, and the code for that dialog happens to not have been used yet (since you started the application), there may be a 3 millisecond delay before it is in place in RAM. Especially for operations that require human intervention of three to four magnitudes higher duration than the page fault handling, the paging means nothing for the performance.

You may monitor page faults and see that in periods, there may be many thousands of them per second. Then you should know how the paging is handled: To sort pages in RAM into "recently referenced" and "not referenced for some time; candidate for yielding if RAM space runs out", at regular intervals, the OS marks all pages in RAM as "not present RAM", by resetting a hardware bit (per page) in the page tables. When the page is reference, an interrupt to the OS is rasied. It looks at the physical RAM address in the page table: OK, this is a valid address, it is not zero, so all that needs to be done is to set the "page present" flag to prevent more such interrupts, and go on.

So you have zillions of page fault interrups that only leads to a flag to be set, no paging operation. If the interrupt handler sees that the RAM address is zero, then it must start a more involved operation. I believe Windows have a third level: A set of RAM pages not used for a LONG time: When it does its regular sweeps resetting the present bit, if the bit was already reset (so the page hasn't been referenced since the previous sweep), the RAM addresses is zeroed in the page table and the page moved to a pool of "standby" pages actually in RAM, that is searched before any disk operation is initiated. If the faulting page is found, its RAM address is inserted into the page table and the page ulinked from the pool.

The OS also keeps a pool of "free" RAM pages: At boot up, all pages are in this pool. As space is being used, for code, data or stack, pages are moved from the free pool into the page tables. When a process terminates, the RAM pages used in physical RAM for the stack and data segments is moved back to the free pool.

If RAM really is crowded, and the requested page is neither flagged as present (so no interrupt is generated), not present but with valid RAM address (so the interrupt handler sets the present flag) or present in the pool of standby pages (so the memory address in the page table must be updated), it must be brought in from disk. This is what causes a real disk access - but that is only a small fraction of the page fault interrupts. If the free pool is not empty, one of its RAM pages is moved to the page table. If the free pool is empty, one a page in the standby pool must yield: Its RAM address is entered int the page tables, its contents overwritten. Its entry in the pool list is removed, so that next time it is referenced, causing a page fault interrupt, it will not be found and must be fetched from disk.

So, you cannot count disk accesses by the number of page fault interrups. You must look at the disk activity.

If you actually manage to generate 30 million page fault interrupts a second, you still may have zero disk accesses: The interrupt handler says: But I have got it here! Take a look in the Memory section of the Resource monitor: Is the Pysical Memory green all the way? (there is a grey part at the bottom; that is DMA buffers for IO equipment.) Is there never any dark blue "Standby", no light blue "Free"? Then you can go to the Disk section and observe how busy your paging disk is. If it is busy more than 20% of the time, then you may have to consider more RAM.

A few points worth noting: If your applications make heavy use of the file system, on the same disk as your page file, a significant part of the disk activity may be other than paging. 20% disk activity may be quite normal with file intensive applications running.

Second: A high number of "real" page faults are perfectly normal when you start a new application. The code and data segments are set up as an extension of the page file, the page tables for all segments set up with reset present flag and zero RAM address. When your application starts up, referencing code and data, each first reference to a page will be treated as a "real" page fault, and the page brought in. For pages from data segments, space in the paging file is not allocated until that page must yield because of RAM crowding, and the page has been modified. Pages from code segments never take any space in the paging file. (For a debugger, the code segments being debugged are data segments!)

Third: Code segments are shared. If you run five instances of your web browser, they address exactly the same RAM pages for the code. (For modified data, each have their own data).

Remember that only actively running code may generate page faults. If you have five instances of your web browser open, you are actively interacting with only one of them, and not with other applications. E.g. a media presentation or animation may run by itself in another window, but the RAM resources it requires are brought in place within milliseconds, and make up a tiny little fraction of the total functionality of the browser. Similar with other systems: When you are not interacting with them, 99+ percent of the time, they will not generate page faults, only when you ask for an operation that you haven't requested for a long time.

It is true that modern software is extremely bloated. But lots of it comes from tons of functions you never need, so they are never brought in from the .exe/.dll file into memory. A lot of stuff is code run once - initialization stuff, or only as a result of explicit user operations taking several magnitudes more time than the page fault, and after two memory sweeps the pages are over in the standby pool, ready for being overwritten by pages from the active working set. So the bloat has far more effect on disk space requirements than on paging.

Now Java and DOM are notorious for building large data structures. But even with those, 8 GByte is a lot. And even if the data structures are large, it is a very special appliaction referencing, say, every single node of the DOM tree all the time. A great deal of it goes first to "not present", then to "standby", and then possibly to the page file on a (single) page by page basis. When a user presses the PageDown key, maybe one or two memory pages have been swapped out. If you have other processes running in the background, they may have had a more urgent need for RAM. So there may be a very slight delay, bringing in that small branch of the DOM tree. Then it is in, and will be present as long as it is used.

I hear you saying that you have an extreme level of paging. I have heard such claims numerous times. When I have dived into it to see if the claims hold water, I have never found a paging disk bottleneck. The typical case is sers who insist that they need more RAM, but when you walk up to them while they work, start Resource Monitor and show them that one third of the RAM they have got is "free", one third is in "standby", and only one third is "in use". You can do that again and again, and every time they say: But wait a second - if I start this and that and that and that, then the "used" part going up, see? Yes, but not in your ordinary mode of working. I am not claiming that it is impossible to overload the RAM, I am just saying that you never do it in you ordinary work.

Those who regularly work with extremely memory intensive tasks like FEM, weather or discrete simulation (an ARM emulator counts only of it emulates down to the gae level - but then you are a hardware developer, not a software developer), they know what they are doing. Also, the software they use cost magnitudes more than 16 or 32 GBytes of RAM. Those are not the ones coming with vague suspicions about unbeliavbly high levels of paging.
GeneralRe: 8GB no longer enough Pin
kalberts28-Aug-19 10:04
kalberts28-Aug-19 10:04 
GeneralRe: 8GB no longer enough Pin
#realJSOP26-Aug-19 0:42
professional#realJSOP26-Aug-19 0:42 
GeneralRe: 8GB no longer enough Pin
raddevus26-Aug-19 1:54
mvaraddevus26-Aug-19 1:54 
GeneralRe: 8GB no longer enough Pin
#realJSOP26-Aug-19 2:30
professional#realJSOP26-Aug-19 2:30 
GeneralRe: 8GB no longer enough Pin
Dan Neely26-Aug-19 3:47
Dan Neely26-Aug-19 3:47 
GeneralRe: 8GB no longer enough Pin
AnotherKen26-Aug-19 6:01
professionalAnotherKen26-Aug-19 6:01 
GeneralRe: 8GB no longer enough Pin
Reelix26-Aug-19 7:38
Reelix26-Aug-19 7:38 
GeneralRe: 8GB no longer enough Pin
raddevus26-Aug-19 7:47
mvaraddevus26-Aug-19 7:47 
GeneralRe: 8GB no longer enough Pin
Member 289602026-Aug-19 10:12
Member 289602026-Aug-19 10:12 
GeneralRe: 8GB no longer enough Pin
raddevus26-Aug-19 10:35
mvaraddevus26-Aug-19 10:35 
GeneralRe: 8GB no longer enough Pin
Daniel Wilianto26-Aug-19 16:22
Daniel Wilianto26-Aug-19 16:22 
GeneralRe: 8GB no longer enough Pin
Member 1391078329-Aug-19 9:21
Member 1391078329-Aug-19 9:21 
GeneralWin10 Popup seems so fake! Pin
raddevus25-Aug-19 10:51
mvaraddevus25-Aug-19 10:51 
GeneralRe: Win10 Popup seems so fake! Pin
OriginalGriff25-Aug-19 11:05
mveOriginalGriff25-Aug-19 11:05 
GeneralRe: Win10 Popup seems so fake! Pin
raddevus25-Aug-19 11:18
mvaraddevus25-Aug-19 11:18 
GeneralRe: Win10 Popup seems so fake! Pin
Randor 25-Aug-19 11:59
professional Randor 25-Aug-19 11:59 
GeneralRe: Win10 Popup seems so fake! Pin
raddevus25-Aug-19 13:07
mvaraddevus25-Aug-19 13:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.