blob: 857ecd2bc2a5253892291e332f83eb80ed9fca88 [file] [log] [blame]
/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.jack.server.tasks;
import com.android.jack.server.JackHttpServer;
import com.android.sched.util.findbugs.SuppressFBWarnings;
import org.simpleframework.http.Request;
import org.simpleframework.http.Response;
import org.simpleframework.http.Status;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nonnull;
/**
* Administrative task: Call {@link System#gc()}.
*/
@SuppressFBWarnings("DM_GC")
public class GC extends SynchronousAdministrativeTask {
@Nonnull
private static Logger logger = Logger.getLogger(GC.class.getName());
public GC(@Nonnull JackHttpServer jackServer) {
super(jackServer);
}
@Override
protected void handle(long taskId, @Nonnull Request request, @Nonnull Response response) {
logger.log(Level.INFO, "Force GC");
System.gc();
response.setStatus(Status.OK);
}
}