A question to system administrators about The Bat! filling free memory with zero bytes

2017-06-23 Thread Maxim Masiutin
Hello ,

I have a question to system administrators (who deal with servers) about The 
Bat! filling free memory with zero bytes.

What do you think if we change The Bat! to intermittently fill with zero bytes 
the memory, with which The Bat! is working on, but frees in the meanwhile (not 
actually uses)? So The Bat! will clean memory pages with zero bytes? This may 
improve performance under Windows, and also under VMWare and other virtual 
machine environments? For example, VMWare and HyperV calculate hash of memory 
pages, and, if the contents is the same, mark this page as "shared" inside a 
virtual machine and between virtual machines on the same host, until the page 
is modified. It effectively decreases memory consumption. Windows does the same 
- it handles zero pages differently, treating them as free.

We could have the heap manager that would automatically fill memory with zeros 
when we call FreeMem/ReallocMem. As an alternative option, we could have a 
function that zeroizes empty memory by demand, i.e. only when this function is 
explicitly called. Of course, this function has to be thread-safe. The drawback 
of filling memory with zeros is touching the memory, which might have already 
been turned into virtual, thus issuing page faults. Besides that, any memory 
store operations are slow, so our program will be slower, albeit to an unknown 
extent (maybe negligible).

If we manage to fill 4-K pages completely with zeros, the hypervisor or Windows 
will explicitly mark it as a zero page. But even partial zeroizing may be 
beneficial, since the hypervisor may compress pages using LZ or similar 
algorithms to save physical memory.

Does anybody have experience on that issue?

I have made a question on 
https://stackoverflow.com/questions/44665446/a-heap-manager-for-c-pascal-that-automatically-fills-freed-memory-with-zero-byte
 on that matter, but it didn't gain enough attention.

-- 
Maxim Masiutin
Director
Ritlabs, SRL



 Current beta is 7.4.16.21 | 'Using TBBETA' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: A question to system administrators about The Bat! filling free memory with zero bytes

2017-06-23 Thread Stuart Pye
Hello Maxim,

Friday, June 23, 2017, 10:31:00 PM, you wrote:

MM> Hello ,
MM>

MM> I have a question to system administrators (who deal with
MM> servers) about The Bat! filling free memory with zero bytes.

I run mail server programs in VMs in hosting centers, all on SSD
drives running Windows OS server versions.  I doubt almost anyone is
running TB, a (desktop) client program, in VM instances on machines
running on their desks, such as laptops, much less TB client programs
also running in hosted VM server instances.  So, am I crazy, or are
you?  I really don't understand what changing how TB handles memory on
the client instance will do anything for the memory subsystems in
hosted mail servers, running bare metal or in VMs.

No disrespect intended.


Best regards,

Stuart Pye



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



 Current beta is 7.4.16.21 | 'Using TBBETA' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: A question to system administrators about The Bat! filling free memory with zero bytes

2017-06-24 Thread Ira
Hello Stuart,

Friday, June 23, 2017, 11:06:25 PM, you wrote:

> I really don't understand what changing how TB handles memory on
> the client instance will do anything for the memory subsystems in
> hosted mail servers, running bare metal or in VMs.

I was going to say something similar but I don't run servers so
it seemed not relevant. Maybe if there are a bunch of people
running The Bat on an application server. All my machine have
16Mb or more so I can't imagine it will make any difference to
me.

-- Ira 



 Current beta is 7.4.16.21 | 'Using TBBETA' information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: A question to system administrators about The Bat! filling free memory with zero bytes

2017-06-24 Thread Maxim Masiutin
Hello Stuart,

Saturday, June 24, 2017, 9:06:25 AM, you wrote:

> I run mail server programs in VMs in hosting centers, all on SSD
> drives running Windows OS server versions.  I doubt almost anyone is
> running TB, a (desktop) client program, in VM instances on machines
> running on their desks, such as laptops, much less TB client programs
> also running in hosted VM server instances.

I saw big companies are running all client software for their employees on 
Virtual Machines (VMs), and the client is just running a thin client computer 
with a remote desktop. This this is safer, cheaper, easier to manage and easier 
to deploy than hundreds of standalone workstations. And that thin client 
computer is cheap and no need to upgrade it - it should be just enough to 
handle remote desktop connection.

I even saw small companies are running vital programs like accounting on VMs 
hosted on remote colocations - for safety and security.

That's why running The Bat! and other client software on VMs is of interest. 
And VMs like when memory, if unused, is not left as it was, with old data 
remnants, but cleaned with all zero bytes.

That's why I think that my question is relevant.

Even if you run The Bat! under a desktop Windows PC - filling memory with zeros 
may be beneficial.

-- 
Maxim Masiutin
Director
Ritlabs, SRL



 Current beta is 7.4.16.21 | 'Using TBBETA' information:
http://www.silverstones.com/thebat/TBUDLInfo.html