How the application works and what the reference type means

Source: Internet
Author: User

Number of bits and memory size of the CPU:

Now the mainstream CPU number is 32-bit and 64-bit, 32-bit CPU indicates that the CPU data bus has 32 root, a data bus can represent the low frequency and high frequency of two currents (0 and 1 respectively), can represent 2 32 data, that is, 4G,CPU can process 4g data each time, So the application's addressing is also 4g (memory), the corresponding maximum memory is the same as the 4g,64 bit. Swap Memory:In memory, some data is not the usual data, it will be saved to the hard disk, when the re-call the resource will reload it into memory, to ensure the maximum efficiency of memory use.
Ordinary applications: Ordinary applications can not directly invoke the CPU and so on hardware resources, can only interact with the operating system, through the interface provided by the operating system to dispatch hardware resources, the operating system provides an executable program interface (Mian method), Windows system can run. NET programs and C + + programs, When the program is running, the Windows Application Loader reads the PE header (the equivalent of a program run tag, marking whether the program is a. NET program or a C + + program, and so on, if it is. NET to the CLR processing), use Notepad to open an EXE file:

You will find that the program you can run has a PE head.

Why you should have a reference type:   Windows above the program can be broadly divided into two types: operating system programs and ordinary applications, operating systems are generally developed by C++/VB, such as direct interaction with the hardware resources, and C # and other high-level languages are interacting with the operating system, the operating system in the implementation of these programs will have some necessary conditions. such as: The NUM variable of type int is declared in the using

Converting to an intermediate language will reveal that all variables are in the Init method, stating that the operating system must determine the amount of memory required by the method prior to executing each method.

Each method is processed by the CPU when the program is run. Methods are often called method stacks, and the program compiler must first calculate the total size of the variables on the method stack. In a word, the system requires the method to determine the total size of the variables on the stack before running, so the system can allocate resources to this method. However, often the development of the program requires some variables that cannot be determined size, such as a collection, the collection will often open a separate space (managed heap), the address of the space on the stack, the address on the stack is determined, so that the system can satisfy the requirements of the program, thus the birth of a reference type.

How the application works and what the reference type means

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.