InitSound() causes page faults

Just starting out? Need help? Post your questions and find answers here.
Cosmoliner
New User
New User
Posts: 2
Joined: Thu Jul 13, 2017 10:29 am

InitSound() causes page faults

Post 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...
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Re: InitSound() causes page faults

Post by Fluid Byte »

Really? No sourcecode? No information about your Windows version? Your Purebasic version? Your drivers? Your hardware? Nothing? Ok ....

Image
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: InitSound() causes page faults

Post 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.
Cosmoliner
New User
New User
Posts: 2
Joined: Thu Jul 13, 2017 10:29 am

Re: InitSound() causes page faults

Post 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.
Post Reply