huihui_1223 2019-11-28 19:05 采纳率: 0%
浏览 538

使用Spring cloud security Oauth2,资源服务器的堆内存使用会持续增长

使用Spring cloud security Oauth2进行接口鉴权,资源服务器使用的堆内存会持续增长,直到设置的-Xmx值,如果使用security.ignored忽略该接口鉴权,就没有这种情况,请问这种情况要怎样解决呀?

接口鉴权的情况下:
接口鉴权

接口取消鉴权的情况下:
接口取消鉴权

资源服务器配置如下:

@Configuration
@EnableResourceServer
public class ResourceConfiguration extends ResourceServerConfigurerAdapter {

    private static final String DEMO_RESOURCE_ID = "*";

    @Autowired
    private RedisConnectionFactory connectionFactory;

    @Bean
    public RedisTokenStore tokenStore() {
        return new RedisTokenStore(connectionFactory);
    }

    @Override
    public void configure(ResourceServerSecurityConfigurer resources) {
        resources.resourceId(DEMO_RESOURCE_ID).stateless(true);
    }

    @Override
    public void configure(HttpSecurity http) throws Exception {

        // @formatter:off
        http
                // Since we want the protected resources to be accessible in the UI as well we need
                // session creation to be allowed (it's disabled by default in 2.0.6)
                .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED)
                .and()
                .authorizeRequests()//请求授权
                .anyRequest().authenticated();//所有的url通过认证后才可以访问



    }

}
  • 写回答

2条回答 默认 最新

  • zqbnqsdsmd 2019-11-29 09:47
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog