|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||
java.lang.Objectorg.jboss.netty.handler.ssl.SslBufferPool
public class SslBufferPool

一个专用于改进SslHandler性能的ByteBuffer池.
在大多数情况,你不需要创建一个新实例,因为SslHandler内部有默认的池实例.
为什么SslHandler需要一个缓冲池的原因是因为当前的SSLEngine对每个 'wrap' 和 'unwrap'
操作都需要17kiB的缓冲.大多数情况下,实际需要的缓冲大小比17kiB小得多,因此为每个 'wrap' 和 'unwrap'
操作分配17KiB缓冲是浪费大量带宽的内存 ,导致程序的性能退化.
| 构造方法摘要 | |
|---|---|
SslBufferPool()
创建一个大小为18113536的缓冲池,能保存1024缓冲. |
|
SslBufferPool(int maxPoolSize)
创建一个新的池. |
|
| 方法摘要 | |
|---|---|
int |
getMaxPoolSize()
返回该池的最大字节数.返回的值与在构造方法指定的值多少有个点不同. |
int |
getUnacquiredPoolSize()
返回已经分配但还未获取的字节数. |
| 从类 java.lang.Object 继承的方法 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public SslBufferPool()
public SslBufferPool(int maxPoolSize)
maxPoolSize - 该池能保存的最大字节数| 方法详细信息 |
|---|
public int getMaxPoolSize()
public int getUnacquiredPoolSize()
0,意味着该池已经为空. If it keeps
returns a unnecessarily big value, it means the pool is wasting the heap
space.
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||