LB Booster
« Open Letter to Chris Iverson »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:02am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Open Letter to Chris Iverson  (Read 731 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Open Letter to Chris Iverson
« Thread started on: Mar 31st, 2016, 10:02am »

I have sent this to Chris Iverson in response to a post at the Liberty BASIC Community Forum:

Chris,

I was surprised to read in your response to John Hinckley that it has been "hard to track down" why exactly the 'unable to allocate virtual address space' error happens. Why it happens is straightforward: LB 4.5.0 attempts to allocate 1 Gbyte of *contiguous* virtual address space (which is half the total user address-space normally available to a Win32 program!) and that amount of contiguous address space is not guaranteed to be available.

As I expect you know, the reason that such a large amount of contiguous address space may not be available is that, before an application gets to run, several DLLs and other 'resident' modules first get loaded into memory. The effect of 'pre loading' those modules is that the address space gets 'fragmented'.

Imagine, for example, that a 1 Megabyte DLL happens to get loaded into memory 500 kBytes below the 1 Gbyte 'boundary'. Now the remaining user address space has been neatly divided into two equal parts, each of which is slightly under 1 Gbyte in size. Although only 1 Megabyte of memory has actually been used by the DLL, an attempt to allocate 1 Gbyte of contiguous address space is bound to fail.

That it sometimes happens and sometimes doesn't really isn't relevant. It will depend on what modules get pre-loaded and where, and that in turn will depend on what utilities and drivers are installed that 'inject' themselves into the address space of any running process (for example it is not uncommon for printer drivers to do that).

Any experienced Windows programmer should know that it isn't safe to allocate as much as 1 Gbyte of contiguous address space in a 32-bit program. If you are unlucky, just one resident module loaded at an 'unfortunate' address is enough to cause such an allocation to fail.

I make this information available in the spirit of cooperation, even though I know it is not reciprocated by the Liberty BASIC community. If it has been helpful I would appreciate an acknowledgement.

Regards,

Richard.

User IP Logged

pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx Re: Open Letter to Chris Iverson
« Reply #1 on: Mar 31st, 2016, 12:45pm »

Clear and elegant! smiley

Pier
User IP Logged

Pensacola Pete
New Member
Image


member is offline

Avatar




PM


Posts: 1
xx Re: Open Letter to Chris Iverson
« Reply #2 on: Jun 1st, 2016, 6:30pm »

Thanks for the explanation. I use another program that is coded in Liberty Basic 4.5. I got the same "unable to allocate virtual address space" message. Previous versions coded in 4.04 didn't have this problem. Thanks to your explanation, I eventually was able to do a workaround by temporarily turning off Bitdefender's active threat scan, which allowed the program to load, then turning back on active threat scan. No idea if this is because what I turned off was occupying a crucial address area.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Open Letter to Chris Iverson
« Reply #3 on: Jun 1st, 2016, 7:10pm »

on Jun 1st, 2016, 6:30pm, Pensacola Pete wrote:
I eventually was able to do a workaround by temporarily turning off Bitdefender's active threat scan, which allowed the program to load

I suppose I should ask why LBB didn't provide a solution in this case. LBB reserves half a Gbyte of contiguous address space by default, which is almost always available, but you can reduce that if necessary by editing the LBB.INI file.

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls