Page 1 of 1

InitSound() causes page faults

Posted: Thu Jul 13, 2017 10:37 am
by Cosmoliner
Hello,

When i am using InitSound() in my programs, the executable
produces a lot more page faults as usual on Windows.
You can check this by enabling the Page Fault column in
Details tab of the Task Manager.

Can anyone confirm this behavior?

I don't know if these page faults cause any problems,
but it doesn't look nice...

Re: InitSound() causes page faults

Posted: Thu Jul 13, 2017 4:54 pm
by Fluid Byte
Really? No sourcecode? No information about your Windows version? Your Purebasic version? Your drivers? Your hardware? Nothing? Ok ....

Image

Re: InitSound() causes page faults

Posted: Thu Jul 13, 2017 10:42 pm
by Dude
Despite the name, page faults are not errors and nothing to worry about. Some cites:

From https://en.wikipedia.org/wiki/Page_fault :

"Contrary to what "fault" might suggest, valid page faults are not errors, and are common and necessary to increase the amount of memory available to programs in any operating system that utilizes virtual memory"

From https://stackoverflow.com/questions/568 ... age-faults :

"page faults occur for many reasons, and they aren't really something to worry about if you're writing a program." (author of "Process Hacker").

"Any time a mmap'd section is read, a page fault is generated, which includes whenever you load a DLL."

So, they're normal for software. Don't sweat it.

Re: InitSound() causes page faults

Posted: Fri Jul 14, 2017 10:30 am
by Cosmoliner
ok, i was just wondering about the behavior that as soon InitSound() is called these faults
are produced constantly. Compared to the other processes in Task Manager this just looks strange.

I tried this with
PB 5.60, 5.44, 5.31, 4.61 - x64/x86, with/without Debugger
on Windows 10 64Bit

Shortest possible code with debugger:

Code: Select all

InitSound()
CallDebugger
or use sound.pb from examples folder.