这些进程对用户体验没有直接的影响,系统可能在任意时间终止它们,以回收内存供前台进程、可见进程及服务进程使用。
These processes have no direct impact on the user experience, and the system can kill them at any time to reclaim memory for a foreground, visible, or service process.
可见,访问内存中的数据要快一百万(或者说106)倍。
Accessing data in memory is thus literally a million (or 106) times faster.
可见,尾部调用使用了更多一些指令,但是它们可以节省相当多内存。
As you can see, tail-calls take a few more instructions, but they can save quite a bit of memory. There are a few restrictions for using them.
这种方法是缺陷是,如果使用率阀值没有微小的增量,则一些粒度级的数据可能会丢失,并且阀值下方的内存使用率模式将变为不可见。
The downside of this approach is that without extremely small increments in the usage threshold, some granularity of data can be lost and patterns of memory usage below the threshold become invisible.
但是同步还有另一个方面:正如JMM所指定,它强制实施某些内存可见性规则。
But synchronization also has another aspect: it enforces certain memory visibility rules as specified by the JMM.
可见性则更为微妙;它要对付内存缓存和编译器优化的各种反常行为。
Visibility is more subtle; it deals with the vagaries of memory caching and compiler optimizations.
换句话说,这意味着老的内存模型只保证正在读或写的变量的可见性,不保证写入其他变量的可见性。
In other words, this means that the old memory model made promises only about the visibility of the variable being read or written, and no promises about the visibility of writes to other variables.
虽然这对于应用程序是不可见的,但是它仍然会造成应用程序耗尽内存,因为即使键被收集了,Map . Entry和值对象也不会被收集。
And while this would be invisible to the application, it could still cause the application to run out of memory because the Map.Entry and value objects would not be collected, even if the key is.
特别是,内存模型定义了保证内存操作跨线程的可见性的volatile、synchronized和final的语义。
In particular, the memory model defines semantics for volatile, synchronized, and final that make guarantees of visibility of memory operations across threads.
内存中只会生成可见的卡片,顶部的卡片被划走之后,会作为最后一张卡片循环利用。
There are only visible cards in memory, after you drag and removed the top one, it will be reused as the last one.
注意,在同一个线程的不同方法之间传递对象的引用,永远也不会出现内存可见性问题。
Note that visibility problems never arise when passing references to objects across methods in the same thread.
注意,在同一个线程的不同方法之间传递对象的引用,永远也不会出现内存可见性问题。
Note that visibility problems never arise when passing references to objects across methods in the same thread.
应用推荐